I am trying to run a console application written in C# using visual studio 2010 in which i am accessing a temp database of Microsoft Sql Server Managment Studio.
But the application gives exception as follows:
"Cannot open database "dbname" requested by the login. The login failed. Login failed for user `machinname\username""
And my connection string is as follows:
con.ConnectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=temp;Integrated Security=True";
Why might this fail with such an error?