Hi everyone,

I don't understand why this doesn't update my actual MS Access 2003 mdb file. During debug phase, I learned that it updates the dataset and creates new rows. But it doesn't reflect into the database. Why is it so? Please help me out. Thanks in advance.

else
            {
                //Auto generate item code            
                txtIcode.Text = this.GenerateCode(ItemDS.Item, "ITM-");

                // Create a new row.
                CSOAIS.BACKEND.DATASETS.ItemDataset.ItemRow NewItemRow;
                NewItemRow = ItemDS.Item.NewItemRow();

                NewItemRow.ItemCode = this.GenerateCode(ItemDS.Item, "ITM-");
                NewItemRow.ItemName = this.txtIname.Text;
                NewItemRow.ItemDesc = this.txtIdesc.Text;
                NewItemRow.CategoryCode = (string)this.cmboCategory.Text;
                NewItemRow.SubCategoryCode = (string)this.cmboSubCat.Text;
                NewItemRow.UnitMeasureCode = (string)this.cmboUM.Text;

                //set default values
                NewItemRow.LocationCode = "CSO";
                NewItemRow.StatusCode = "Active";

                // Add the row to the Item table
                ItemDS.Item.Rows.Add(NewItemRow);

                // Save the new row to the database
                this.itemTableAdapter.Update(ItemDS.Item);
 
            }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.