Hi there!
how I can find out why ExecuteNonQuery() return 0 and not 1 by submit?
at this moment I see no chance to know why my query isn't submited.
thx
gicio
Printable View
Hi there!
how I can find out why ExecuteNonQuery() return 0 and not 1 by submit?
at this moment I see no chance to know why my query isn't submited.
thx
gicio
ExecuteNonQuery() does not return any rows. You use this when you want to perform insert, update or delete on the table. You should use ExecuteScalar() is you just want a single value.
ExecuteNonQuery() returns how many rows were effected.Quote:
Originally posted by DevGrp
ExecuteNonQuery() does not return any rows. You use this when you want to perform insert, update or delete on the table. You should use ExecuteScalar() is you just want a single value.
gicio, check your sql statement or stored procedure (if you use it).
Try executing the statement directly against the database and see the outcome.
If he just wants to know the affected rows, he can use ExecuteNonQuery() function. As the name suggests. This function does not perform a query against the DB. It just returns the rows that were affected during an update, delete or insert.