Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
Overriding/setting connectionstring before opening report
posted

I am accessing an SQL Server using SQL Server authentication, and I dont want to store the password in the configfile for the project.

For other dataconnecting in the project I set the password-part of the connectionstring when the application reads the config-file (see code below).

However it seems like when the infragistics report reads the connectionstring it does not seem to invoke the event that I am using to capture the reading of the settingsfile.

How should I set the connectionstring for the infragistics-report while opening a VB Winform with a infragistics-reportviewer?

Regards

Kai-Inge

Namespace My

'This class allows you to handle specific events on the settings class:
' The SettingChanging event is raised before a setting's value is changed.
' The PropertyChanged event is raised after a setting's value is changed.
' The SettingsLoaded event is raised after the setting values are loaded.
' The SettingsSaving event is raised before the setting values are saved.
Partial Friend NotInheritable Class MySettings


Default Public Overrides Property Item(ByVal propertyName As String) As Object


Get
If propertyName = "MyConnectionString" Then

Return MyBase.Item(propertyName) & GetPassword  ' Getpassword function ads the password-part to string read from the settingfile

End If
Return MyBase.Item(propertyName)
End Get
Set(ByVal value As Object)
MyBase.Item(propertyName) = value
End Set
End Property

End Class
End Namespace