Showing posts with label locally. Show all posts
Showing posts with label locally. Show all posts

Wednesday, March 28, 2012

Newbie question about SQL Server 2005

Hi,

I have a very newbie question.

I have been only developing websites locally on my computer (during my learning curve) and never actually put anything up in a server on internet, but I just bought a server from discountasp.net and an extra SQL 2005 Database.

Now I need to put my database on that server (copy the local one) I know I have a connection string and username and password. But I really do not have any ideas how to do this.

I would appreciate if you tell me where to start and what I should do at this stage.

Thank you and have a good day.

Use SQL Server 2005 Management Studio to connect to your databse on server. And after that you can import the databse from local database.|||Thank you, but is there any tutorials explaining this in more detail ?|||

Hi,

This tutorial might prove useful on the issue of migrating databases:

http://msdn2.microsoft.com/en-us/library/ms188032.aspx

Cheers

|||

The tutorial may help.

http://aspnet.4guysfromrolla.com/articles/050907-1.aspx

Monday, March 26, 2012

Newbie question - Best practices for local/remote development?

Excuse me, I'm a relative newbie.

My question: What's the best practice for developing locally and then uploading to a production web site?"

Here's my plan:

I will use ASP.NET 2.0. I want to use Visual Web Developer 2005 Express Edition to develop locally using SQL Server 2005 Express Edition (.mdf file).

Then I want to upload my changes to a web site that uses the full version of SQL Server 2005 (not the Express Edition.)

I know how to upload my .aspx files to the remote site using Visual Web Developer.

But how should I handle my data? I imagine I can keep a little test data in my local .mdf database, and then just make sure the tables on the remote SQL Server always exactly mirror what I've got locally.

Then I just upload any changed .aspx files, which should work both locally and remotely.

Is this the best way? Or will I have to every time first change something in my .aspx files, to handle the data connection difference between my local db to the remote db?

Much ThanksThe convention is to store your database ConnectionString in the Web.Config file. Then you will only have one place to change it. See http://www.dotnetjohn.com/articles.aspx?articleid=3

Monday, March 19, 2012

Newbie needs help

Hi,
I am using SQLEXPRESS running locally on my machine and am trying to create
a database (AdventureWorks) for an example that I am using. What complicates
this a bit is that this example is using NAnt. The local.properties.xml file
contains the following:
<?xml version="1.0"?>
<properties>
<property name="sqlToolsFolder" value="C:\Program Files\Microsoft SQL
Server\90\Tools\Binn"/>
<property name="osql.ConnectionString" value="-E"/>
<property name="initial.catalog" value="AdventureWorks"/>
<property name="config.ConnectionString" value="data
source=SQLEXPRESS;Integrated Security=SSPI;Initial
Catalog=${initial.catalog}"/> <property name="database.path"
value="C:\root\development\databases" />
<property name="osql.exe" value="${sqlToolsFolder}\osql.exe" />
</properties>
When I open the Enterprise Manager and run the script for attach.sql the
database is created fine.
when I run the "build builddb" I get the following error:
NAnt 0.85 (Build 0.85.2139.0; nightly; 11/9/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///C:/root/development/playground/adventureworks/avworks.bui
ld
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: builddb
[echo] Loading local.properties.xml
builddb:
exec.sql.template:
convert.template:
[copy] Copying 1 file to
'C:\root\development\playground\adventur
eworks\sql
\attach.sql'.
[exec] Msg 1813, Level 16, State 2, Server OHBOCXX99RMRVK, Line 1
[exec] Could not open new database 'AdventureWorks'. CREATE DATABASE is
aborted.
[exec] Msg 602, Level 21, State 50, Server OHBOCXX99RMRVK, Line 1
[exec] Could not find row in sysindexes for database ID 13, object ID
1, in
dex ID 1.
[exec] Run DBCC CHECKTABLE on sysindexes.
BUILD FAILED
C:\root\development\playground\adventure
works\avworks.build(60,10):
External Program Failed: C:\Program Files\Microsoft SQL
Server\90\Tools\Binn\osq
l.exe (return code was 1)
Total time: 1.8 seconds.
When I installed SQLEXPRESS, I installed it using Windows Authentication and
I would think that Integrated Security would work. I'll bet I'm doing
something silly, but I've tried to figure it out with no luck.
thanks in advance!
BillChances are they are using the AdventureWorks sample database which come
populated with a bunch of sample data. You can download it here:
http://www.microsoft.com/downloads/...&displaylang=en
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Bill44077" <Bill44077@.discussions.microsoft.com> wrote in message
news:A1B3826A-0D0F-4B1F-804A-DB222842D778@.microsoft.com...
> Hi,
> I am using SQLEXPRESS running locally on my machine and am trying to
> create
> a database (AdventureWorks) for an example that I am using. What
> complicates
> this a bit is that this example is using NAnt. The local.properties.xml
> file
> contains the following:
> <?xml version="1.0"?>
> <properties>
> <property name="sqlToolsFolder" value="C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn"/>
> <property name="osql.ConnectionString" value="-E"/>
> <property name="initial.catalog" value="AdventureWorks"/>
> <property name="config.ConnectionString" value="data
> source=SQLEXPRESS;Integrated Security=SSPI;Initial
> Catalog=${initial.catalog}"/> <property name="database.path"
> value="C:\root\development\databases" />
> <property name="osql.exe" value="${sqlToolsFolder}\osql.exe" />
> </properties>
> When I open the Enterprise Manager and run the script for attach.sql the
> database is created fine.
> when I run the "build builddb" I get the following error:
> NAnt 0.85 (Build 0.85.2139.0; nightly; 11/9/2005)
> Copyright (C) 2001-2005 Gerry Shaw
> http://nant.sourceforge.net
> Buildfile:
> file:///C:/root/development/playground/adventureworks/avworks.build
> Target framework: Microsoft .NET Framework 2.0
> Target(s) specified: builddb
> [echo] Loading local.properties.xml
> builddb:
>
> exec.sql.template:
>
> convert.template:
> [copy] Copying 1 file to
> 'C:\root\development\playground\adventur
eworks\sql
> \attach.sql'.
> [exec] Msg 1813, Level 16, State 2, Server OHBOCXX99RMRVK, Line 1
> [exec] Could not open new database 'AdventureWorks'. CREATE DATABA
SE
> is
> aborted.
> [exec] Msg 602, Level 21, State 50, Server OHBOCXX99RMRVK, Line 1
> [exec] Could not find row in sysindexes for database ID 13, object
ID
> 1, in
> dex ID 1.
> [exec] Run DBCC CHECKTABLE on sysindexes.
> BUILD FAILED
> C:\root\development\playground\adventure
works\avworks.build(60,10):
> External Program Failed: C:\Program Files\Microsoft SQL
> Server\90\Tools\Binn\osq
> l.exe (return code was 1)
> Total time: 1.8 seconds.
> When I installed SQLEXPRESS, I installed it using Windows Authentication
> and
> I would think that Integrated Security would work. I'll bet I'm doing
> something silly, but I've tried to figure it out with no luck.
> thanks in advance!
> Bill