Author: zubair01 | Posted on: 1/24/2010 5:55:11 AM | Views : 323

Hi! everyone, I am bit confuse related to connection strings. I have created a sample database (Employee.mdf) and placed it in app_code folder.
I have seen connectionStrings of two different format, one which is automatically created by sqldatasource and the other which is something like this.


<add name="connectionstring1" providerName="System.Data.SqlClient" connectionString="Server=.\SQLEXPRESS; Database=Employee.mdf; Integrated Security=SSPI" />
but exceptional error occurs when i use this connection string.
Error:
Cannot open database "Employee.mdf" requested by the login. The login failed.
Login failed for user 'MICROSOF-YQ5HDR\Microsoft'.


While this connectionString works fine.
<add name="ConnectionString2" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Employee.mdf;Integrated Security=True;User Instance=T ...

Go to the complete details ...