Closed
Description
In this below the call to cn.ChangeDatabase fails because the connection is not yet open - it needs moving to after the cn.Open()
try
{
if (!database.Equals("master", StringComparison.InvariantCultureIgnoreCase))
{
cn.ChangeDatabase(database);
}
var sqlBatch = string.Empty;
var cmd = new SqlCommand(string.Empty, cn);
cn.Open();
Metadata
Metadata
Assignees
Labels
No labels