|
-
Mar 25th, 2003, 04:08 AM
#1
Thread Starter
Member
(C# and ADO.NET) ExecuteNonQuery() problem
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
-
Mar 25th, 2003, 12:35 PM
#2
Frenzied Member
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.
Dont gain the world and lose your soul
-
Mar 27th, 2003, 10:22 AM
#3
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.
ExecuteNonQuery() returns how many rows were effected.
gicio, check your sql statement or stored procedure (if you use it).
Try executing the statement directly against the database and see the outcome.
-
Mar 27th, 2003, 10:36 AM
#4
Frenzied Member
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.
Dont gain the world and lose your soul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|