Hello,
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?
Jigs28
0
Light Poster
Recommended Answers
Jump to PostWhat error does it give and what exactly do you mean by 'different output'. The connection string you have in your app.config is exactly the same as the one you used in your class?
Jump to Postwell, 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 …
Jump to PostYour data source will need to be the actual location of the database, so if it resides on F drive you will need to include the full path to the file.
Jump to PostNo, your .cs file should be OK. If the error solely relates to not being able to locate the database then the connection string in the config file was the problem.
All 16 Replies
hericles
289
Master Poster
Featured Poster
Jigs28
0
Light Poster
hericles
289
Master Poster
Featured Poster
Jigs28
0
Light Poster
hericles
289
Master Poster
Featured Poster
Jigs28
0
Light Poster
hericles
289
Master Poster
Featured Poster
Jigs28
0
Light Poster
hericles
289
Master Poster
Featured Poster
Jigs28
0
Light Poster
hericles
289
Master Poster
Featured Poster
Jigs28
0
Light Poster
Jigs28
0
Light Poster
LP...
0
Newbie Poster
Jigs28
0
Light Poster
mani-hellboy
-10
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.