Jim Lizzi

Jim Lizzi

  • NA
  • 4
  • 0

DataSet Not Commiting Changes to the DataBase

Jan 23 2010 9:15 PM
Hi I have a DAL which works with a database Local to the project... a .sdf file.  I created my DAL then created some basic classes for my BLL.  When call the update statement in my BLL from my tableadapter my dataset gets updated but the changes never make it to the database for some reason.  Below is my code for inserting an item, in my DAL I have GenerateDBDIrect set to true and my Insert Command is populated.  What am I doing wrong?
 [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
public bool InsertProduct(string product, string description)
{
CaseManager.App_Data.CaseManagerDataSet.t_ProductsDataTable pDT = new CaseManager.App_Data.CaseManagerDataSet.t_ProductsDataTable();
CaseManager.App_Data.CaseManagerDataSet.t_ProductsRow pRow = pDT.Newt_ProductsRow();

pRow.Product = product;
pRow.Description = description;

pDT.Addt_ProductsRow(pRow);
int rowsAffected = ProductsAdapter.Update(pDT);
ProductsAdapter.Adapter.Update(pDT);
return (rowsAffected == 1);
}