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 ClassEnd Namespace
Thanks,
Hello Kai-Inge,
Please take a look at the following article which provides information about changing the connection string at runtime.
http://es.infragistics.com/community/blogs/damyan_petev/archive/2012/07/27/changing-reports-connection-strings-at-run-time.aspx