Get affected rows on ExecuteNonQuery

.net, c#, executenonquery, mysql, sql

Solution

`ExecuteNonQuery` - returns the number of rows affected.

SqlCommand comm;
// other codes
int numberOfRecords = comm.ExecuteNonQuery();

Problem

I am currently working on a C# project and I am running an insert query which also does a select at the same time, e.g.: ``` INSERT INTO table (SELECT * FROM table WHERE column=date) ``` Is there a way I can see how many rows were inserted during this query?

Original source