ExecuteNonQuery 方法不會返回任何資料庫的資料, 它只會返回整數值來表示成功或受影響的資料列數目.

If use ExecuteNonQuery to create or modify database structure, eg. create table, this method returns -1 if success, returns 0 if fail.

ExecuteNonQuery 用來創建或修改資料庫的結構,如建立table,成功回1,失敗回0

If use ExecuteNonQuery to INSERT, UPDATE, DELETE, this method returns the Number of affected data row, but if fail, it returns 0.

如果用來新增修改刪除,成功它會返回受影響的列數,失敗回0.

arrow
arrow
    文章標籤
    c# ExecuteNonQuery return value
    全站熱搜

    痞客興 發表在 痞客邦 留言(0) 人氣()