private void btnConfirmUpdate_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; PoArray[updatnumber].location = txtEditLocation.Text; PoArray[updatnumber].quantity = txtEditQuantity.Text; GrdPO.DataSource = null; dt.Clear(); for (int i = 0; i < PoArray.Count; i++) { Object[] array = new Object[4]; array[0] = PoArray[i].itemno; array[1] = PoArray[i].itemDescription; array[2] = PoArray[i].location; array[3] = PoArray[i].quantity; dt.Rows.Add(array); } Object[] arraySQLUpdate = new Object[2]; arraySQLUpdate[0] = txtEditLocation.Text; arraySQLUpdate[1] = Convert.ToInt32(txtEditQuantity.Text.Trim()); CompactSQL comsql = new CompactSQL(); comsql.updatePOLine(arraySQLUpdate, Convert.ToInt32(txtLineno.Text)); //CompactSQL comsql = new CompactSQL(); getdata = comsql.SelectRecord("PurchaseOrder"); GetSQLData(getdata, false); //GrdPO.DataSource = dt; Cursor.Current = Cursors.Default; MessageBox.Show("Updated Succesfully!"); } catch (Exception ex) { Cursor.Current = Cursors.Default; MessageBox.Show(ex.Message); } }