connection strings can be handled just like any other string
depending on how the config file is written, i use the StreamReader class for reading text files if it's an xml file then i use a dataset for ease of use
but once you've read in the info simply assign the string to the database connection
There's no need for you to do the reading. If you create the connection in the design window then you can use the Properties window to automatically save and retrieve the ConnectionString through the ApplicationSettings. If you haven't created the connection in the designer you can still use settings. You go to the Settings tab of the project properties, then save your connection string as a String. Whatever name you use for the setting then becomes a property of the My.Settings object, so at run time you can just do this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.