I am trying to do something that I find very simple. I have a connection string that I am retrieving from the database. When I create a new instance of the SQL connection, it looks (when I debug and look at the object), similar to how it correctly fills the db connection string. However, the messasge error that I get makes me think that all information after the underscore in the database name is resolved.
Ex code:
Database db = new SqlDatabase(ConnectionString); // Connection string appears correct
DbCommand dbCommand = db.GetStoredProcCommand("StoredProcName");
DataSet approverDataset = db.ExecuteDataSet(dbCommand); // when this executes, exception is generated
When I run this code, I am greeted with the following exception message: Server manager "testdb_psidentity" cannot access the database "testdb" in the current security context
Here is my String connection:
DataSource=testserver.com;Database=testdb_ps;Trusted_Connection=false;uid=testdb_psidentity;pwd=testpwd
I tried changing this to:
DataSource=testserver.com;Database=[testdb_ps];Trusted_Connection=false;uid=testdb_psidentity;pwd=testpwd
, , , , . :
"[testdb_ps]", . .
'testdb_psidentity'.
/ SQL-.
, testdb_ps? , , , .