StrataFrame Forum

Error in Insert (Save)

http://forum.strataframe.net/Topic16334.aspx

By Angela Sampaio - 5/12/2008

Hi,



I have a BO of products that contains a field pro_nrow; this field is the Primary Key and the "Auto Incrementing" is enabled (Seed 1, Increment 1).



When I try save a product, appears a error message





Unable to enter an explicit value for the identity column of the table 'tabproduto' when IDENTITY_INSERT is set to OFF.



When I insert directly into a database gives certain.



I looked debug.html the file and noticed that he is going empty ('') for the pro_nrow.

Is attached the image of debug.html



Thank you.
By Greg McGuffey - 5/12/2008

Is the BO setup correctly? It should be setup (in the CRUD settings area) with PrimaryKeyIsAutoIncremented=True, PrimaryKeyIsUpdatable=False and the field that is the PK should be shown as the PK in the BO Mapper (which will set that field as the PK when you build the BO).
By Angela Sampaio - 5/12/2008

Yes, the BO is setup correctly...

I don't know what more can be causing this problem...
By Angela Sampaio - 5/12/2008

Hi Greg,



I find the problem ...

In the "ProdutoBO.cs" file the properties were set correctly, but in the form of product the BO "sysProdutoBO1" the property PrimaryKeyIsAutoIncremented was as false.



Now is correctly.

Thanks!
By Greg McGuffey - 5/12/2008

Glad you found it!
By Trent L. Taylor - 5/13/2008

Good to hear you found your problem.