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"
Loading
CrishPosted Dec 10, 2010, 6:09 AM
If you have connection string problem than just refer this below link. I think it will help you.
http://www.connectionstrings.com/
ArshadPosted Dec 7, 2010, 8:16 AM
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