Have a problem with setting up Identity_insert.
SqlCommand AddValueRecord = new SqlCommand($"SET IDENTITY_INSERT {TableName} ON "
+ $"INSERT INTO " + TableName + $" VALUES ('{row.Field<string>(0)}',{row.Field<double>(1)},'{sqlFormattedDate}')"
+ $"SET IDENTITY_INSERT {TableName} OFF", cn, tr);
AddValueRecord.ExecuteNonQuery();
All i have is ex
Additional information: An explicit value for the identity column in table 'Root' can only be specified when a column list is used and IDENTITY_INSERT is ON.