Trying to get simple count from table results in exception bellow.
Tried different select statemens which also makes exception: \"SELECT * FROM goods
\", but \"<
In place of this statement:
using (MySqlCommand cmd = new MySqlCommand("SELECT count(*) FROM goods", conn))
Use:
using (var cmd = new MySqlCommand("SELECT COUNT(*) FROM goods", conn))
and then convert it to int value by using ExecuteScalar(). Something like this:
int count = Convert.ToInt32(cmd.ExecuteScalar());