ExecuteNonQuery doesn't return results

后端 未结 9 1874
迷失自我
迷失自我 2020-11-28 10:46

This is my (rough) code (DAL):

int i;
// Some other declarations

SqlCommand myCmdObject = new SqlCommand(\"some query\");

conn.open();
i = myCmdObject.Exec         


        
9条回答
  •  粉色の甜心
    2020-11-28 11:20

    if you want to run an update, delete, or insert statement, you should use the ExecuteNonQuery. ExecuteNonQuery returns the number of rows affected by the statement.

    How to Set Count On

提交回复
热议问题