I am trying to insert a row into an SQL Compact database using LINQ and the entity framework, and I can't seem to insert rows. I have the following code:
which, from what I've read, is the right way to do it, but it doesn't insert the row. it silently fails - no exceptions thrown - and no row appears in the table.Code:InventoryEntities invEnt = new InventoryEntities(); product myProduct = new product(); myProduct.id_product = 0; myProduct.item_num = frmCreate.ItemNum; myProduct.description = frmCreate.ItemDesc; myProduct.min_qty = frmCreate.MinLevel; myProduct.par_qty = frmCreate.ParLevel; invEnt.AddToproduct(myProduct); invEnt.SaveChanges();
What am I doing wrong?