当我尝试连接到 sql server 时出现此错误,我不明白为什么。这是错误:
Error: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception.
Stack Trace: at System.Data.SqlClient.SqlConnection..ctor()
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
这是我的代码:
connectionString = "Data Source=localhost\SQLEXPRESSSERVER;Initial Catalog=TEST_DATABASE;User ID=USERNAME;Password=PASSWORD;"
Dim myConnection As New SqlConnection(connectionString)
myConnection.Open()