protected void btnYes_Click(object sender, EventArgs e) { try { //ItemsGridView.DeleteRow(ItemsGridView.SelectedIndex); GridDataItem item = (GridDataItem)ItemsGridView.SelectedItems[0]; //JC_ID,BOM_ID string jc_id = item.GetDataKeyValue("JC_ID").ToString(); string bom_id = item.GetDataKeyValue("SPL_ID").ToString(); dsErectionTableAdapters.VIEW_SITE_JC_SPLTableAdapter rec = new VIEW_SITE_JC_SPLTableAdapter(); rec.DeleteQuery(decimal.Parse(jc_id), decimal.Parse(bom_id)); Master.ShowMessage("Spool deleted"); ItemsGridView.Rebind(); } catch (Exception ex) { Master.ShowWarn(ex.Message); } }