Usa SqlCommand.ExecuteScalar() e lancialo in un int
:
cmd.CommandText = "SELECT COUNT(*) FROM table_name";
Int32 count = (Int32) cmd.ExecuteScalar();
Usa SqlCommand.ExecuteScalar() e lancialo in un int
:
cmd.CommandText = "SELECT COUNT(*) FROM table_name";
Int32 count = (Int32) cmd.ExecuteScalar();