Hi,
Just started at looking at connecting to local SQL Server Express DB from C# and I'm using the MS Press C# Step by Step 2005 book.
Page 413 and it says that you do the Data\New Data Source menu and then click the New Connection button and choose the "Microsoft SQL Server" data source and then select the ".Net Framework Data Provider for SQL Server"
Only problem is, I don't have the "Microsoft SQL Server" listed - just "Microsoft Access Database file" and "Microsoft SQL Server Database File" - and it doesn't work with the second one when I select the MDF file for the example's Northwind database.
Gah! Fallen at the first hurdle it seems.... :(

problem connecting to sql server express from c#
pmanisekaran
Kareem Shaker
Did you create a SQL database file already If you did then you need to choose database after you get through the data/new data source menu thing.....
If you didnt make the database then I can help with that to, just tell me
JMaddry
In the end I reverted to type and manually constructed a connection string and did it all manually and it worked OK....
dataConnection.ConnectionString = "User ID = " + userName + ";" +
"Password = " + password + ";" +
"Integrated Security = True; " +
"Initial Catalog = Northwind; " +
"Data Source = vaio\\sqlexpress";
dataConnection.Open();
Thanks