'My ExecuteNonQuery returns -1 even though 4 rows are affected
When I run the query against the database, I get (4 row(s) affected).
When I run it through C#, I get -1 as the return value.
This is my code:
cmd.CommandText = "SELECT name FROM stock";
int x = cmd.ExecuteNonQuery();
Why do I get -1?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
