M
Michael C
I'm writing an app on the PDA using C# with .net 1.1. It is all working well
except in some cases a try catch is simply ignored and a totally different
error is returned. I've got code like below to execute a command. I'm
simulating loss of connection by stopping sqlserver during a transaction.
The problem is I cannot trap the error and I get a stack overflow exception
way up the stack at a Form.ShowDialog(). I've done a break on
executenonquery below and then pushed F11 and the catches both get ignored
and execution jumps up the stack without any code running at all.
I know this is a bit of an obsure problem but I appreciate any input. I
couldn't find anything on google.
Regards,
Michael
try
{
_Command.ExecuteNonQuery();
}
catch(SqlException ex)
{
throw new Exception(ex.Message);
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}
except in some cases a try catch is simply ignored and a totally different
error is returned. I've got code like below to execute a command. I'm
simulating loss of connection by stopping sqlserver during a transaction.
The problem is I cannot trap the error and I get a stack overflow exception
way up the stack at a Form.ShowDialog(). I've done a break on
executenonquery below and then pushed F11 and the catches both get ignored
and execution jumps up the stack without any code running at all.
I know this is a bit of an obsure problem but I appreciate any input. I
couldn't find anything on google.
Regards,
Michael
try
{
_Command.ExecuteNonQuery();
}
catch(SqlException ex)
{
throw new Exception(ex.Message);
}
catch(Exception ex)
{
throw new Exception(ex.Message);
}