Why an InvalidOperationException for OleDbConnection / C#?
string connectionString =
"Provider=SQLOLEDB.1;" +
"Integrated Security=SSPI;" +
"Persist Security Info=False;" +
"Trusted_Connection=False;" +
"Data Source=XXX-LAPTOP\\SQLEXPRESS;" +
"Initial Catalog=C:\\...\\SqlServerDbExample.mdf";
OleDbConnection oleConnection = new OleDbConnection(connectionString);
The oleConnection.ServerVersion throws an exception of type System.InvalidOperationException.
I have viewed the SQL Server Management Studio (SSMS): ... {database name} -> Properties ... Security -> Windows Authentication mode (radio button), Failed logins only (radio button) ... Permissions -> View Server Permissions -> {computer name} -> Effective (tab) -> everything is listed