Get affected rows on ExecuteNonQuery

后端 未结 5 1289
梦毁少年i
梦毁少年i 2020-12-01 17:35

I am currently working on a C# project and I am running an insert query which also does a select at the same time, e.g.:



        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 18:09

    ExecuteNonQuery - returns the number of rows affected.

    SqlCommand comm;
    // other codes
    int numberOfRecords = comm.ExecuteNonQuery();
    

提交回复
热议问题