请看下面的代码:
Public Shared Sub SyncConnectionStrings()
Dim strCon As String
Dim tyDatabase As typeDatabase
Dim boolConfigChanged As Boolean
'Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim strConnectionString As ConnectionStringSettings
For Each strConnectionString In ConfigurationManager.ConnectionStrings
'More code here, but irrelevant for this question.
Next
End Sub
代码循环遍历 app.config 文件中的所有连接字符串。中有三个连接字符串app.config
,但是找到了四个连接字符串。在哪里:LocalSqlServer(这是ConfigurationManager.ConnectionStrings.Name
)定义的?