Hello guys,

I am using connected architecture to develop an application.
For every form am designing there requires to put the connection string to connect to databse. Is there any way that If I change connection string at one point it is automatically changed at other.


Declare the string in the application settings, then call that setting.


'In Application Settings

Name | Type |   Scope   | Value
myCon|String|Application|'Your Connection String Here

'In code
Dim con As New OleDBConnection(My.Settings.myCon)

If the string is changed in the application settings - it is changed globally.

@Begginnerdev: What if i use Type as Connection String ?
IN that Case it aint working !

Any Suggestions ??

I am assuming you are using a project data source?

Is this correct?

If so, what error/message are you getting when you change the connection string?

If not, where is the ConnectionString type coming from?

Is it a custom class/type/structure?

This article has been dead for over six months. Start a new discussion instead.