Programmatically setting a connectionString property winforms

  • Thread starter Thread starter fullstop
  • Start date Start date
F

fullstop

Guest
Hi ,

I have a connection string in a separate dll file, and i need to change it on run time. While this code works in vb.net in c# it doesn't.

Private Sub MySettings_SettingsLoaded(sender As Object, e As SettingsLoadedEventArgs) Handles Me.SettingsLoaded


NewDbConnection = " proper conn string"
If Not IsNothing(NewDbConnection) Then
Me.Item("ConnectionString") =NewDbConnection

End If




End Sub


why this is not working in c#? I need the dynamic change because I'm getting the connection from a Registry

can someone provide a solution?

Thanks

N.

Continue reading...
 
Back
Top