Why does this exception rarely throw?
-
I am using a datagrid in my form sometimes when a child form of this datagrid form closed an exception like "Column C does not belong to the table T" was thrown. this exception is rarely occured so rarely and I can not find the way that it was generated, so I can not debug the the exception. does anybody know how to generate this exception and how to handle it.
-
I am using a datagrid in my form sometimes when a child form of this datagrid form closed an exception like "Column C does not belong to the table T" was thrown. this exception is rarely occured so rarely and I can not find the way that it was generated, so I can not debug the the exception. does anybody know how to generate this exception and how to handle it.
hi, The exception is because you are accessing some column which is doesn't belongs to that perticular table. Reason may you are using datatable which is in form1 to some other form. And the point your are closing the form. The entire object are disposed. See better try to catch your exception and getback to me. try { //Put your logic here } catch(exception Ex) { MessageBox.Show(Ex.Message.ToString()); } Check what are the avilable (members) which you are accessing outside your form1 class file. ************************** S r e e j i t h N a i r **************************
-
hi, The exception is because you are accessing some column which is doesn't belongs to that perticular table. Reason may you are using datatable which is in form1 to some other form. And the point your are closing the form. The entire object are disposed. See better try to catch your exception and getback to me. try { //Put your logic here } catch(exception Ex) { MessageBox.Show(Ex.Message.ToString()); } Check what are the avilable (members) which you are accessing outside your form1 class file. ************************** S r e e j i t h N a i r **************************
Thanks for your guide. I know how can I catch the exceptions in my codes. Also I know if a column does not belong to a table, I couldn't access the column. But if you read my message again I describe that this error is appeared so rarely. So I couldn't catch it. regards, Mehdi