LCKB
[C#] Mysql count Updates - Printable Version

+- LCKB (https://lckb.dev/forum)
+-- Forum: ** OLD LCKB DATABASE ** (https://lckb.dev/forum/forumdisplay.php?fid=109)
+--- Forum: Programmers Gateway (https://lckb.dev/forum/forumdisplay.php?fid=196)
+---- Forum: Coders Talk (https://lckb.dev/forum/forumdisplay.php?fid=192)
+---- Thread: [C#] Mysql count Updates (/showthread.php?tid=1330)



- Nikolee - 11-30-2012


Hey i wanna now how i can count the updates which was made by the programm?

So if i run a UPDATE query that i know how many updates was done.




- Wizatek - 11-30-2012


Its the return value of ExecuteNonQuery

 




- Nikolee - 11-30-2012


This only return the amoun of the Querys i runned.

and i need how many updates are done in the database




- Wizatek - 11-30-2012


No, it returns how many rows were affected by the query

 

 

2

 

25.2.3.1.5. ExecuteNonQuery

 

Executes a SQL statement against the connection and returns the number of rows affected.

 

Returns: Number of rows affected




- Nikolee - 11-30-2012


Ah yes if i update 2 things and i do Console.WriteLine(cmd.ExecuteNonQuery());

it write me 1, but 2 times.

so its right.

Thank you wiza.