I have solved my issue. Here is the code I used.
DataTable dt = new DataTable();
SqlDataReader sqlDataReader = com3.ExecuteReader();
dt.Load(sqlDataReader);
sqlDataReader.Close();
GridView dataGridView4 = new GridView();
GridView4.DataSource = dt;
GridView4.DataBind();
lblCount4.Text = GridView4.Rows.Count.ToString();