Answers for "count number of rows in a table in c#"

C#
0

count number of rows in a table in c#

conString = ConfigurationManager.ConnectionStrings["ConString"].ConnectionString;
using (var conn = new MySqlConnection(conString))
{
  conn.Open();
  using (var cmd = new MySqlCommand("SELECT COUNT(*) FROM DBName.Table.name", conn))
  {
    puzzCount = Convert.ToInt32(cmd.ExecuteScalar());
  }
}
Posted by: Guest on May-05-2022

Code answers related to "count number of rows in a table in c#"

C# Answers by Framework

Browse Popular Code Answers by Language