Not sure why this is failing...I'm sure it's my fault. Any help would be greatly appreciated.
I'm getting the classic
Cannot open database "Northwind" requested by the login. The login failed. Login failed for user 'MyMachine\MyUserName'.
I can login just fine using windows authentication through SQL Server Management Studio.
I checked in SQL Server Management Studio to make sure that my user has permission to use the Northwind database. I also tried most of the other responses to this question posted here on stackoverflow.
This is my code:
SqlConnection dataConnection = new SqlConnection();
try
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = ".\\SQLExpress";
builder.InitialCatalog = "Northwind";
builder.IntegratedSecurity = true;
dataConnection.ConnectionString = builder.ConnectionString;
dataConnection.Open();
... .
I'm using SQL Server 2008 Express