I have created project in c# and i want to use connection string stored in app.config file in all my form. I have wrote that connectionManager code but it gives different output (not proper output) and sometimes it gives exception what to do?
Ok tell of only that thing, connection string written in app.config file in that |datadirectory| this we have to change to some drive name where database is stored like F: \databasename ? Because if i dont change it than it gives exception for some table that table not found. Not for all tables. So should i change it? Will it give any problem in future?
well, your connection string (where ever you store it) will need to point to the actual location of the database or you will have problems. If the connection string is wrong you will get an error for all tables though as your code can't locate the database, let alone specific tables within it.
It might be time to post some code up so we can understand the issue.
Ok. In .cs i have written that configuration manager wala code only. So it automaticaly rfrs to config file.by that name attribute. So whnevr if i run my prjct on anthr pc so nly i hav 2 chang path in one file only
You can attach the database when you build your installer, its been a while since I've done and I can't remember the exact steps but you'll find an online tutorial to help. Or, if the config specifies the correct location, you can just dump the database there afterwards. But location will matter. If you have specified a drive and folder where the database will be it will need to be there.
Supposean giving may application's setup file to any user for his use and he is a non technical person than if he install app than to he has to dump database file in his pc? Even if he dont know what is database? Or is it like that when a person installing application database file should get store automatically in program file folder
Put Your Database From F: drive into your project folder then It will be work for you
way to add open your project in Vstudio2005/2008/2010 then in right corner solution explorer perform right click select ( add-> new item ) one window open in that you select Local database then browse your database and select it it will auto matically included to your project
Another way copy your database and save to your project folder it may in your local drive such as C,D,F or in my documents->visual studio->projects->your project name