Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
"An error occurred while executing the command definition. See the inner exception for details" - This error shows while executing the invoice code. how to overcome this
C#
{
           try
           {
               if (_custid > 0 && _branchid > 0)
               {
                   //_Invoiclst = accobj.GetInvoiceByCustomerID(56, 0, 1, 2).EntityList;
                   _Invoiclst = accobj.GetInvoiceByCustomerID(_custid, _VoucherID, ConstStrings.CompanyID, _branchid).EntityList;
                   cboInvoice.DataSource = _Invoiclst;
                   cboInvoice.DisplayMember = "InvoiceNo";
                   cboInvoice.ValueMember = "InvoiceID";
               }

           }
           catch (Exception ex)
           {
               ShowInfoMessage(ex.Message);
           }
Posted

1 solution

Well, see InnerException for more detail: http://msdn.microsoft.com/en-us/library/system.exception.innerexception%28v=vs.110%29.aspx[^].

I don't know what your method you use in your exception method does, but probably it is not informative enough. You can inspect and show inner exceptions, recursively, parameters, StackTrace, full or simple type name, message…

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900