1.11M Members

Connection String in connected architecture.

 
0
 

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.

Thanks

 
0
 

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

Example:

'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.

 
0
 

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

Any Suggestions ??

 
0
 

Is this ConnectionString a Type, or are you refering the the SQLClient.ConnectionString property?

 
0
 

@Begginnerdev: ConnectionString is a type in settings of project.

 
0
 

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?

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article