Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • 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?

                                0

                                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.

                                Thanks,
                                Max

                                0

                                Hi,

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

                                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
                                increment.

                                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.

                                To start a chat you should create a support ticket


                                If you need additional product information, write to us at info@devexpress.com 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, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

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