同じクエリでwhere条件を使用しながら、テーブルの行数をカウントする方法。以下のクエリを使用して、departmentnameが電気工学と等しい行数を取得していますが、これは現在、正しいクエリで機能しています
SqlCommand cmd1 = new SqlCommand("Select count(*) from Student
where DepartmentName = 'DepartmentOfElectricalEngineering' ");
cmd1.Connection = conn;
studentdata[4] = cmd1.ExecuteScalar().ToString();