Friday, July 25, 2008

ExecuteNonQuery 傳回值

ExecuteNonQuery 方法不會返回任何 data record row, 它只會返回整數值, 來表示成功或受影響的data row 數目.

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

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

No comments: