try { SqlConnection cons = new SqlConnection(constr); cons.Open(); SqlCommand cmd = new SqlCommand("update emp table set empid=" + dataGridView1.ColumnCount + ",empname=" + dataGridView1.ColumnCount + ",empadd=" + dataGridView1.ColumnCount + ""); SqlDataAdapter sda=new SqlDataAdapter(cmd); DataSet ds=new DataSet(); sda.Fill(ds); dataGridView1.DataSource=ds.Tables[0]; cons.Close(); } catch(Exception) { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)