Inserting a record

Hi!

I was playing around with WinForms demo that comes with Jasper CTP. The demos use Nortwind database and there is a form that allows insertion of records into Products table (SimpleForm.vb).

Since ProductID field is identity field I would like to enter only ProductName, but I can't persuade Jasper to ignore ProductID. I tried to delete the field from the form, but after calling context.SaveChanges Jasper responds with "Cannot insert the value NULL into column 'ProductName', table 'Northwind.dbo.Products'; column does not allow nulls. INSERT fails.The statement has been terminated." I would like Jasper to create an INSERT command like this one:

Code Snippet
insert into Products (ProductName) values ('new one')
Is this possible?

Thank you,

Andreja

[938 byte] By [newdrim] at [2008-2-15]
# 1

Hi Andreja -

The error from your post indicates that you are trying to insert null into the ProductName field, not a problem with the ProductID field.

Can you post the code that is giving you problems? Jasper supports identity columns, and I am currently able to insert new records into the Products table in the Northwind sample database.

Thanks -

Andy

AndrewConrad-MSFT at 2007-9-13 > top of Msdn Tech,Incubation Technologies,Project Codename: Jasper...