>I have played around with the database, and it definately is a problem with the uniqueness of the primary key, which is an identity field. I don't understand why it is throwing a non-unique error when it is creating the key. I will try making a combination key on different fields. I am using the exact same thing, but writing to a different table in the same routine without problems. One table has 85 items and writes without problems. The other has 258 items and it throws that error when it tries to update in the mmDataAccessSql method. When I investigate a few of the items in the entity instance, it looks as if it is generating different numbers. This table is a detail table and it begins being totally empty of any data. So he issue appears to be something within this method. I tried doing mulitple inserts from the actual stored procedure, and I don't have any problems with the insert proc.
Is the primary key being generated by the SQL Server or is it being generated by default values in the business object? If the key is being left to be generated on the SQL server and you have it set as unique at the business object I have seen it cause this problem. I have all my primary keys being set at the business object and not the SQL server. That way I know what it is before it is saved, and the business object makes sure there is a unique value before trying to save.
Tim
Timothy Bryan