SELECT Count(*) as mycount FROM score where subject='" + comboBox1.Text + "' C# mysql 将查询结果写成数组
这个结果只是一个数字,没有必要用数组
MySqlCommand cmd = new MySqlCommand("SELECT Count(*) as mycount FROM score where subject='" + comboBox1.Text + "', conn);
DataReader dr = cmd.ExecuteReader();
dr.Read();
int cnt = int.Parse(dr["mycount"].ToString());