Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Cannot open database "" requested by the login. The login failed. Login failed for user ''.

the following error is generated while connecting to database

connection string in web.config

<add name="Homeconstr" connectionString="Server=.\sqlexpress;database=CorporateDatabase1;Integrated Security=true">


connection in aspx file

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Homeconstr"].ConnectionString);
        con.Open();
Posted
Updated 5-Oct-12 0:19am
v2

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