petre ricardo

petre ricardo

  • NA
  • 194
  • 0

How to send the exception message to the caller

Sep 13 2009 11:12 AM

Hi,
I have the following method:
 public void SaveData
{
   try
   {
      connectionObj.Open();
      int i = command.ExecuteNonQuery()
      connectionObj.Open();
   }
catch(SQLException ex)
{
   //i want to add a custome error message to teh message Property of "ex" and 
//i want to throw "ex" object to the caller
}
}

how do i add a custome error message to teh message Property of "ex" and throw the ex object to teh caller from catch block?
 
TY in Advance

Answers (2)