try{ SqlConnection con = new SqlConnection("");//connection name con.Open(); SqlCommand cmd = new SqlCommand("select * from tablename", con); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "ss"); dataGridView1.DataSource = ds.Tables["ss"]; ; // dataGridView1.DataBind(); } catch { MessageBox.Show("No Record Found"); }
gowthaman8870226416
Thanks, Arefin
Mark as Answer if its helpful to you Kumaraspcode2009@gmail.com
Login to post response