I need to insert a row and use that "last id" immediately so I need to execute a query like this
INSERT INTO table_name (col1, col2,...) VALUES ('val1', 'val2'...);
SELECT LAST_INSERT_ID();
I know that to INSERT I must call cmd.ExecuteNonQuery()
and to SELECT I call cmd.ExecuteReader()
But how to do both in a single query?