You can use datareader to for connected architecture
SqlCommand cm = new SqlCommand("Select * from table1", con);
SqlDataReader dr;
dr = cm.ExecuteReader();
DataTable dataTable = new DataTable();
dataTable.Load(dr);
in case of winform
dataGridView1.DataSource = dataTable;
in case of webform
GridView1.DataSource = dataTable;
GridView1.databind();