The same query works fine in SQL Server. I need it to return all rows read from the DB table in c#.
SqlCommand cmd = new SqlCommand();
cmd.Connection = connection;
cmd.CommandText = @"SELECT TypeName, Sum(HitNo) FROM TypeHit GROUP BY TypeName";
SqlDataReader sdr = cmd1.ExecuteReader();
sdr.Read();
if (sdr.HasRows)
{
while (sdr.Read())
{
TextBox1.Text = sdr.GetString(0) +" at " + sdr.GetInt32(1);
}
}