-
system error?
at the executenonreader statement, i always get a system error. what am i doing wrong?
Code:
string SQLConnString = myConnection;
SqlConnection myConn = new SqlConnection(SQLConnString);
myConn.Open();
SqlCommand myCommand = new SqlCommand("USE " + TxtDBName.Text + " " + storeProcString);
SqlDataAdapter da1 = new SqlDataAdapter(myCommand);
myCommand.Connection = myConn;
myCommand.ExecuteNonQuery();
myConn.Close();
-
Try:
Code:
string SQLConnString = myConnection;
SqlConnection myConn = new SqlConnection(SQLConnString);
SqlCommand myCommand = new SqlCommand("USE " + TxtDBName.Text + " " + storeProcString, myConn);
SqlDataAdapter da1 = new SqlDataAdapter(myCommand);
myCommand.ExecuteNonQuery();
DJ
-
If you put your code in a try...catch block, and catch the SqlExcpetion, you'll get better details of the exact problem.