Click here to Skip to main content
16,016,501 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Exception Details: System.Data.SqlClient.SqlException: An explicit value for the identity column in table 'user_Master' can only be specified when a column list is used and IDENTITY_INSERT is ON.



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.




Exception Details: System.Data.SqlClient.SqlException: An explicit value for the identity column in table 'user_master' can only be specified when a column list is used and IDENTITY_INSERT is ON.
Posted

1 solution

You tried to issue an INSERT query, in which you included the identity column (identity column is auto-generated, so if you want to specify the identity value while you insert new rows, database system has to be tweaked). But, most of the time, you do not need to set the identity yourself when you insert; let the database engine do what it has been made for.

Solution is:

- Strip off the identity column from your insert query

OR

- Make this column a non-identity one (you will then loose the auto-generation feature)
 
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