Current filter:
                                You should refresh the page.
                                Support Center
                                  • I'm getting an exception when inserting Contact record while building the tutorial app. "System.Data.SqlClient.SqlException: Cannot insert explicit value for identity column in table 'Contact' when IDENTITY_INSERT is set to OFF."

                                    What might I be doing wrong to get this error?


                                Hi Richard,

                                Sorry, we cannot tell you what may be wrong right away. There must be a eXpressAppFramework.log file created in the same folder where your EXE is located. Please run the application, recreate the issue, close the application and post the log file here for further investigation.




                                The resolution is at the database level. In MS SQL 2005 / 2008 do the

                                First - Using SQL Manager or another tool; right click on the TABLE which
                                is giving the error. In the table properties there is an element called
                                IDENTITY. Set this to the COLUMN fieldname that you want to auto

                                Second - Execute the following SQL statement on your table:
                                Set Identity_Insert db.TableName ON;

                                Replace db.TableName with your tablename.

                                That's it. You do not have to select, show, update, or do anything to that
                                column going forward. It will automatically update / increment whenever a
                                new row is added. And the error described will go away.

                                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