Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmDataAccessSql throwing an error.
Message
From
03/08/2009 18:29:05
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
03/08/2009 18:00:41
Tegron Tegron
Platinum Technologies
Ohio, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01415935
Message ID:
01415976
Views:
36
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform