avi avi - 1 month ago 13
Vb.net Question

Cannot insert explicit value for identity column in table 'StatusChange' when IDENTITY_INSERT is set to OFF. in asp.net using vb.net

I am designing web application when I click save it shows the error Cannot insert explicit value for identity column in table 'StatusChange' when IDENTITY_INSERT is set to OFF.please anyone help me to fix this. Below is the code for status change.

Answer

You can check table identity before to save as below

select is_identity from sys.columns where object_id = OBJECT_ID('[dbo].[StatusChange]', 'U') and name = 'column_Name'