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
 General SQL Server Forums
 New to SQL Server Programming
 connecting to database

Author  Topic 

roop
Starting Member

9 Posts

Posted - 2007-09-17 : 04:40:12
hi,

i have to give connection string in .cs file
as SQLConnection cn=new SQLConnection("")

i have to connect to local computer..please anyone provide me solution.
datbase is northwind...and i m connected it with windows authentication..
please any one provide me answer....

Kristen
Test

22859 Posts

Posted - 2007-09-17 : 04:43:34
See www.connectionstrings.com

Kristen
Go to Top of Page

roop
Starting Member

9 Posts

Posted - 2007-09-17 : 04:44:36
i hav eonge through this link but..thats not working....
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-09-17 : 07:42:35
post your code here


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2007-09-17 : 07:48:23
If you're using SQL 2005 make sure you know the instance name or if it's on the default instance.

default instance = localhost or . or ipaddress or hostname

another instance = .\instancename or hostname\instancename or localhost\instancename

Make sure that in the configuration tool you are allowing tcp/ip connections and remote connections if you want to connect from another machine.



http://www.connectionstrings.com/?carrier=sqlserver2005
Go to Top of Page

sherlock_oz
Starting Member

12 Posts

Posted - 2007-09-18 : 02:19:55
If you get a copy of C# express edition or Visual basic express edition, start a new project and then follow the add datasource wizard to add your database file , the IDE will write the connection string for you.
have a look at the contents of the "app.config" file in solution explorer.
this should show you the way
hope this helps
Go to Top of Page
   

- Advertisement -