Click here to Skip to main content
15,917,005 members
Please Sign up or sign in to vote.
1.33/5 (6 votes)
See more:
Hello all,

I have 10 forms with 1 mdi. In every form I give same connection string.

I want to genrate connection string in all forms. I want to give only one time connection string and genrate automatically in all forms.

Simple:
only one connection string load in all forms.
Posted
Updated 3-Jan-11 1:20am
v2

Google for app.config and connectionstrings section.

Cheers
 
Share this answer
 
Comments
Manfred Rudolf Bihy 3-Jan-11 13:44pm    
Well observed! 5+
Actually i can't understand what u wrote.
"In every form I give same connection string."
where you gave that?
If you gave that connection string in application setting, you can easily access that from any form inside your app using:
Dim ConStr As String = My.Settings.YourConnectionString

U don't have to give individual connection string in every form. :thumbsup:
 
Share this answer
 
Comments
Manfred Rudolf Bihy 3-Jan-11 13:46pm    
This question was already answered 5h ago. Please read the other posts before you write an answer. Thank you!
Аslam Iqbal 3-Jan-11 14:42pm    
Is this restricted to answer an unsolved 6 hours old problem? I don't think so.
aidin Tajadod 3-Jan-11 17:24pm    
It does not flag as solved!!!!
fjdiewornncalwe 8-Jan-11 13:59pm    
1: Your answer adds nothing to the answer by Estys. If your answer is the same as a previous one with a small enhancement, feel free to add a comment with your additional points. That way the answers stay clearer and less confusing for everyone.
have you visited the webpage ConnectionStrings.com ?
 
Share this answer
 
Comments
fjdiewornncalwe 3-Jan-11 21:24pm    
This doesn't answer what the OP is asking.

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