apgriffiths 0 Newbie Poster

I am quite new at c# development but i have a good understanding.

I have an app that includes a strongly typed dataset from a datasource called RouteFormatData.mdf

I have three tables in the database, AddDetails, NetworkCodes and Products.

I have a table adapters for each table, the problem i am having is with the AddDetails table where i am trying to insert new data into the table. I have created an Insert Command on the table adapter that takes in 8 parameters for a row. When i am executing ths insert statement the code runs fine without error but when i check the table data afterwards the new data has not been inserted.

Here is the code that executes the insert command,

RouteFormatDataDataSetTableAdapters.AddDetailsTableAdapter insertAddress =
                    new RouteFormat.RouteFormatDataDataSetTableAdapters.AddDetailsTableAdapter();
                
                foreach (DataRow dr in inTable.StopTable.Rows)
                {
                    addDetailsTableAdapter1.InsertNewStop(Convert.ToInt32(dr[0]), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(),
                        dr[4].ToString(), dr[5].ToString(), dr[6].ToString(), dr[7].ToString());
                }

I have no idea why the data is not inserting into the table.

I have also tried dragging the table adapter component from the toolbox onto the form and then using that to execute the insert command but i still get the same result.

Any help is much appreciated.