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.

文章標籤
全站熱搜
創作者介紹
創作者 痞客興 的頭像
痞客興

痞客興的部落格

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