Click here to Skip to main content
15,917,926 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am reading a book in which following code is written to connect to a database:
string source = "server=(local)\\NetSDK;" +
                "uid=QSUser;pwd=QSPassword;" + 
                "database=Northwind";
string select = "SELECT ContactName,CompanyName FROM Customers";
SqlConnection conn = new SqlConnection(source);
conn.Open();
SqlCommand cmd = new SqlCommand(select, conn);

I am new to C# and databases.
I donot understand which database is being used. Perhaps it is Northwind.sdf. I donot know where to place the file so that I can work with the connection.
Please explain me how to get connected to the database.
Thanks in advance.
Posted
Comments
Sandeep Mewara 12-Jan-11 3:42am    
Demanding and rude!

1 solution

 
Share this answer
 
Comments
Shah Rukh Qasim 12-Jan-11 1:28am    
I have the file. Just tell me where to put it and what to do to get connected to it.
Sandeep Mewara 12-Jan-11 3:43am    
Countered 1 with 5!

@ShahRukh Qasim: It was way rude and demanding. If the answer was not that helpful or you were still facing issues, you could have asked nicely.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900