Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 web.config connection string for SQLServer DB

Author  Topic 

CZH
Starting Member

3 Posts

Posted - 2009-08-27 : 04:08:49
Hi, i cant figure out how to connect an SQL server 08 database to a website in web.config in VS08 . . . can anybody help ?

Thanks

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-08-27 : 06:35:19
[code]

</configSections>
<appSettings />
<connectionStrings>
<add name="db_connection" connectionString="Data Source=databasename,port_number;Network Library=DBMSSOCN;Initial Catalog=1newday;User ID='username';Password='password';" providerName="System.Data.SqlClient" />

</connectionStrings>
<system.web>
[/code]

the you can reference the variable name "db_connection" in your code or classes.
Go to Top of Page

CZH
Starting Member

3 Posts

Posted - 2009-09-02 : 06:12:59
Thanks you very much it's a great help.

If anyone has anyother way of making a connection to an SQL server DB please let me know so i can try as many as poss

Thanks again !
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2009-09-02 : 06:38:01
http://www.connectionstrings.com/sql-server-2008
Go to Top of Page

afrika
Master Smack Fu Yak Hacker

2706 Posts

Posted - 2009-09-02 : 07:50:11
what other way do you mean ???
Go to Top of Page

CZH
Starting Member

3 Posts

Posted - 2009-09-02 : 09:41:34
Any if there is any other ways. i'm new to it all but i have to do a database driven website and i'm picking it up as i go.



Libraries\Pictures
Go to Top of Page
   

- Advertisement -