combo_ci
یک شنبه 14 تیر 1388, 10:56 صبح
سلام
من از اين كد توي پروژه هاي vb.net استفاده ميكنم براي reload كردن connectionString توي فايل appconfig
وقتي convert ميكنمش به c# به MySettingsProperty.Settings.Reload گير ميده
كسي ميتونه تبديل اين كد به c# رو دربياره
ممنون
Public Shared Sub ChangeConnectionString(ByVal strConn As String, ByVal Optional ConnectionIndex As Integer = 0)
Dim _config As Configuration = ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None)
If (_config.ConnectionStrings.ConnectionStrings.Count > 1) Then
_config.ConnectionStrings.ConnectionStrings.Item(( ConnectionIndex + 1)).ConnectionString = strConn
_config.Save(ConfigurationSaveMode.Modified)
ConfigurationManager.RefreshSection(_config.Connec tionStrings.SectionInformation.Name)
MySettingsProperty.Settings.Reload
End If
End Sub
من از اين كد توي پروژه هاي vb.net استفاده ميكنم براي reload كردن connectionString توي فايل appconfig
وقتي convert ميكنمش به c# به MySettingsProperty.Settings.Reload گير ميده
كسي ميتونه تبديل اين كد به c# رو دربياره
ممنون
Public Shared Sub ChangeConnectionString(ByVal strConn As String, ByVal Optional ConnectionIndex As Integer = 0)
Dim _config As Configuration = ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None)
If (_config.ConnectionStrings.ConnectionStrings.Count > 1) Then
_config.ConnectionStrings.ConnectionStrings.Item(( ConnectionIndex + 1)).ConnectionString = strConn
_config.Save(ConfigurationSaveMode.Modified)
ConfigurationManager.RefreshSection(_config.Connec tionStrings.SectionInformation.Name)
MySettingsProperty.Settings.Reload
End If
End Sub