J
John
Hi all, I have a question about capturing exception details in C#.
Is it possible to query the exception and get an id related to what caused
the exception??
e.g
1 = Tried to enter a row into a database but there was a Primary Key
conflict
Currently I am doing something like this
catch(Exception ex){
if (ex.Message.ToString().ToLower().IndexOf("primary key")>0){
But this looks decidely suspect so if anyone knows of a better way, I am all
ears
Thanks
Mark
Is it possible to query the exception and get an id related to what caused
the exception??
e.g
1 = Tried to enter a row into a database but there was a Primary Key
conflict
Currently I am doing something like this
catch(Exception ex){
if (ex.Message.ToString().ToLower().IndexOf("primary key")>0){
But this looks decidely suspect so if anyone knows of a better way, I am all
ears

Thanks
Mark