While updating records using Command Object, its poping error The Connection
is closed, but at the same time if i add the record no such error arises.
the source code is as under, plz help :
private void cmdEdit_Click(object sender, System.EventArgs e)
{try{
String strIsDerived = (rbIsDerived.Checked?"1":"0");
String strSQL = "Update UOM set UOMName = '" + txtUOMName.Text + "',UOMUNITS
= " + txtUnits.Text + ",UOMCODE = '" + txtUOMCode.Text + "', ISDERIVED = '"
+ strIsDerived + "', PARENTUOMID = '" + txtParent.Text + "' Where UOMID = '"
+ txtUOMID.Text + "'";
OracleCommand cmd = new OracleCommand(strSQL,cnn);
cmd.ExecuteNonQuery();
}
catch(OracleException oe)
{
MessageBox.Show("Oracle Exception " + oe.Message + ": Unable to Update");
}
catch(Exception ex)
{
MessageBox.Show("Exception " + ex.Message + ": Unable to Update");
}
}
While deleting the record its hanged waiting internally for sum other
function to finish off, its hanged when i call cmdDelete.ExecuteNonQuery(),
the code is similar to wats been mentioned above, except the query is
"Delete from ..."