dear friends please help me. i am attaching database to set up project and for that following connection string is using. this connection string is sucessfully running on windows forms in c# but it is not successfully running in class library
please help
"Data Source=.\\SQLEXPRESS;AttachDbFilename=" +Application.StartupPath + "\\dm\\hm.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
Connection string
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ArshadRank #2,492 · 564 reputationPosted Dec 7, 2010, 3:16 AM EST
If you want to refer the connection from the app config file of class library, It does not work.
Once you will add that class library into the WinApp or webApplication, your app will refer the connection string from config file of winApp or WebApplication respectively.
If you want to maintain the connectionstring in side of class library, then you can add that into the settings of classlibrary and you can refer in your code like below.
ClassLibraryName.Properties.Settings.Default.ConnectionString.
Regards,
Arshad
CrishRank #1,486 · 1.1K reputationPosted Dec 10, 2010, 1:09 AM EST
If you have connection string problem than just refer this below link. I think it will help you.
http://www.connectionstrings.com/