private void selectrow() { int i; for( i=0 ;i<datagridview1 .rows="" .count="" mode="hold" /> { string row = dataGridView1.Rows[i].Cells["Name"].Value.ToString(); if (row =="") { sqlconn.Open(); string sqlquery = "select * from tbl... where id='" + dataGridView1.Rows[i].Cells["id"].Value.ToString() + "'"; SqlCommand sqlcmd = new SqlCommand(sqlquery, sqlconn); SqlDataAdapter sqlda = new SqlDataAdapter(sqlcmd); DataTable dt = new DataTable(); sqlda.Fill(dt); dataGridView1.DataSource = dt; sqlconn.Close(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)