ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Import Data from Excel Error: Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF<p>Hi <a class="username" rel="akhter"> akhter</a>,</p> <p>You are inserting different columns from code and your table structure is different than your provided code.</p> <p>As per the error you are inserting values for ODID that is an identity column.</p> <p>You can turn on identity insert on the table like this so that you can specify your own identity values.</p> <pre class="brush: sql">SET IDENTITY_INSERT OrderDetail ON; GO -- Your Insert query. SET IDENTITY_INSERT OrderDetail OFF; GO</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/624422/Import-Data-from-Excel-Error-Cannot-insert-explicit-value-for-identity-column-in-table-when-IDENTITYINSERT-is-set-to-OFF/https://www.aspforums.net:443/Threads/624422/Import-Data-from-Excel-Error-Cannot-insert-explicit-value-for-identity-column-in-table-when-IDENTITYINSERT-is-set-to-OFF/Thu, 25 Jul 2019 00:39:09 GMT