vinu cha

vinu cha

  • NA
  • 2
  • 3.9k

Update and Delete Data With DataGridView in Windows Form Using

Dec 1 2012 5:21 AM
i am new to c# .

i have data in my gridview , now how to  Update and Delete Data With DataGridView

below code is for geeting data in gridview  its working fine :


private
void findlaksajob_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)13) { string sql = "SELECT [Jobcard],[Planqty],[Mouldqty],[Operator],[Supervisor],[Profilename],[Process],[Date],[Remark],[Approvedby],[id],[Division],[Od] FROM [SAPProduction].[ProductionData] WHERE JobCard ='" + findlaksajob.Text.ToString() + "'"; SqlDataAdapter da = new SqlDataAdapter(sql, objConn1); DataSet ds = new DataSet(); objConn1.Open(); da.Fill(ds, "ProductionData"); dataGridView2.DataSource = ds; dataGridView2.DataMember = "ProductionData"; objConn1.Close(); e.Handled = true; }   }


Answers (1)