string commandLine SELECT COUNT FROM accounts using MySqlConnection co

1
2
3
4
5
6
7
8
string commandLine = "SELECT COUNT(*) FROM accounts";
using (MySqlConnection connect = new MySqlConnection(connectionStringMySql))
using (MySqlCommand cmd = new MySqlCommand(commandLine, connect))
{
connect.Open();
return Convert.ToInt32(cmd.ExecuteScalar());
}