Current filter:
                                You should refresh the page.
                                Support Center
                                  • Receiving error: Exception has been thrown by the target of an invocation.

                                    I get this error when I use a Stored Procedure to perform an insert from the dataset (which is attached to ObjectDataSource and then to your ASPxWebGrid). The Grid fails with this error the first time I click Update. The second time I click Update it works with no error.

                                    Again, this does not work on the first click, but does on the second click of the Update link.

                                    Steps to Reproduce:

                                    Create Dataset from SQL Table

                                    Change the Insert Method to a stored procedure

                                    Stored Procedure Script looks like this:


                                    ALTER PROCEDURE [dbo].[INSERT_NEW_CH_CONTAINER_pr]

                                         @CONTAINERID AS VARCHAR(50),

                                         @SITEID AS VARCHAR(15),

                                        @LINER_TYPE AS VARCHAR(50),

                                         @CONTAINER_TYPE AS VARCHAR(50),

                                         @WASTE_MAT_PARAMS AS VARCHAR(50),

                                         @WWIS_STATUS AS VARCHAR(50),

                                         @CONTAINER_STATUS AS VARCHAR(50),

                                         @CONTAINER_STATUS_DATE AS DATETIME



                                         SET NOCOUNT ON;     





                                         VALUES (     @CONTAINERID,@SITEID,@LINER_TYPE,@CONTAINER_TYPE,







                                                              INTO CONTAINER.DBO.CH_AK_MASTER     (      CONTAINERID)

                                                             VALUES                                        (     @CONTAINERID)     






                                    Actual Results:

                                    Exception has been thrown by the target of an invocation.

                                    Expected Results:

                                    Insert record successfully the first time.


                                Hello Ray,

                                Thank you for your report. We need additional information to determine what's wrong and to fix the problem.

                                1. Please capture the exception stack trace and send it to us. To catch the exception, the following options must be set:
                                1) In the Tools | Options... dialog, go to the Debugging node and uncheck the Enable Just My Code (Managed Only) checkbox.
                                2) In the Debug | Exceptions... dialog, check the Thrown checkbox for Common Language Runtime Exceptions.

                                2. Send source code of your web page with the ASPxGridView (~.aspx and ~.vb files) and source code of your data object (~.vb).



                                Your steps to enabled the debugging features helped discover the true problem. Our Foreign Key contraints were setup incorrectly from within MS SQL. Thank you for your quick response.


                                Thank you for your quick response!

                                If you need additional product information, write to us at or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners