I've got a situation where I'm creating and saving multiple records to a SQL Server table and in one table I have no problems. The PK field in that table is set as an Identity column and when I attempted to add three records with nothing in that column (you know, not zero, not null, just "nothing"). It barfed and said the column would not accept nulls. So I specifically replaced the field in each record with zero. Then it saved just fine. However, on the second table, where it seems to be set up the same way, I can't get it to work. I got the "can't accept nulls" error, but replacing that field with a zero for each record causes an error that reads:
Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'project' when IDENTITY_INSERT is set to OFF.
So inserting multiple records in the first column with an "explicit" value of zero (which really will be changed to some other value SQL Server determines) works fine, but in the second table SQL Server does not like it. As I mentioned, both tables seem to be set up the same: an ID column defined as BigInt and with this column set as an Identity column.
Any thoughts would be appreciated.
Russell Campbell