Groups | Blog | Home
all groups > visual studio .net general > october 2003 >

visual studio .net general : Help with local -> remote DB connections


tim NO[at]SPAM broadbanned.net
10/19/2003 8:34:10 PM
Hello,
I'm new to VS.NET and am developing an ASP.NET web application. it
uses a SQL server 2000 DB. I have a local environment set up, and
once the app has been developed locally i will need to upload it to
the live server.

My question is: What is the best way to develop so that when i am
ready to upload to the live server I only need to change the DB
connection string once.

I have set up a DB connection in VS and when i drop it onto pages it
creates a sqlconnection string in the code behind file.
when i drag and drop a db table or stored procedure onto the designer
surface it also creates the connection in the code behind file for me.

how can i easily change all the connections from server=localhost to
server=999.99.99.99 ??

i set up a connection string in the web.config file (and can later
easily change this for the live server) but can't see how to use that
with visual studios drag and drop features.

I hope someone can see my issue and help. any replys pointing me in
the right direction would be greatly appreciated.

Thanks
Tony B
10/22/2003 8:20:18 AM
Hi Tim

It would be worth having a look at the DotNetNuke portal www.dotnetnuke.com
.. This app uses a connection that is declared in the Web.config file and is
called via classes(I think) whenever a connection to the DB is required.
This way you do not have to change all your pages that use a connection.

HTH

Tony

[quoted text, click to view]

Tony B
10/27/2003 6:54:37 PM
Try this link

http://www.123aspx.com/redir.aspx?res=456


[quoted text, click to view]

AddThis Social Bookmark Button