I getting this error when I try to connection to sql server and I dont understand why. Here is the error:
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)
Here is my code:
connectionString = "Data Source=localhost\SQLEXPRESSSERVER;Initial Catalog=TEST_DATABASE;User ID=USERNAME;Password=PASSWORD;"
Dim myConnection As New SqlConnection(connectionString)
myConnection.Open()