Click here to Skip to main content
15,912,507 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
con = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=global::motion.Resources.db_imageDataSet;Integrated Security=True;Connect Timeout=30;User Instance=True");

is it correct
here i have used sqlserver DB
and its file is
C:\Users\r\Desktop\final output\latest Rcar - Copy\motion\Resources\db_image.mdf

so how can correct it
Posted
Updated 23-Mar-11 7:38am
v2
Comments
Wendelius 23-Mar-11 13:39pm    
What error are you getting?
Sandeep Mewara 23-Mar-11 13:42pm    
Any error? What?
vishnulalr 23-Mar-11 13:42pm    
error is already existing same DB file
vishnulalr 23-Mar-11 13:43pm    
here i want to connect the DB file from the resource folder from the project itself.In ordinary case DB file is put in a local folder and reference it using its path
and i want to avoid that
so how can i modify my above code

If the database is already attached, go to Management Studio and detach the database from the SQL Server instance. After that your code should be able to attach the database when you run it.
 
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