N
newscorrespondent
A System.Exception has a Data property that I would like to add data to
before I call my standard exception handler. When in a routine that uses SQL
server I would like to add the
System.Data.SqlClient.SqlConnectionSQLConnection,
System.Data.SqlClient.SqlCommand and System.Data.SqlClient.SqlDataReader
when there is one.
Exception abc = new Exception("abc");
abc.Data.Add("TheConnection",TheConnection);
abc.Data.Add("TheSQLCommand", TheSQLCommand);
abc.Data.Add("Reader", TheReader);
This compiles but at run time an exception is thrown because these are not
serialiazable. How can I put these into the Excpetions data property?
Thanks
before I call my standard exception handler. When in a routine that uses SQL
server I would like to add the
System.Data.SqlClient.SqlConnectionSQLConnection,
System.Data.SqlClient.SqlCommand and System.Data.SqlClient.SqlDataReader
when there is one.
Exception abc = new Exception("abc");
abc.Data.Add("TheConnection",TheConnection);
abc.Data.Add("TheSQLCommand", TheSQLCommand);
abc.Data.Add("Reader", TheReader);
This compiles but at run time an exception is thrown because these are not
serialiazable. How can I put these into the Excpetions data property?
Thanks