Click here to Skip to main content
16,016,770 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have database indexdb.mdf

i want to connect to it using Sql ConnectionString and want to check its status on Open as...
C#
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS; AttachDbFilename=D:\PROJECTS\Project\App_Data\indexdb.mdf;
Integrated Security=True;
User Instance=True");

con.Open();


Not working. Status coming to be closed. how to do it??
Posted
Updated 27-Jul-11 6:25am
v3

Is your database already Attached ? or u want to attached it using code.

If you want to attach your database then Click here[^]
 
Share this answer
 

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