Is it possible to add a new row to a database using DataSet? When I created a new DataSet and dragged the table from the database I could see that in the DataSet methods there was one called insert that in the preview showed a parameterized query almost like a stored procedure to insert data.
However, when I create a new object of that DataSet in the methods there is nothing called insert or nothing that says I can insert the data from a DataSet into a database.
From Msdn, you need to use the
TableAdapter that is created:
If you do not have an instance available, instantiate the TableAdapter
you want to use.
NorthwindDataSetTableAdapters.RegionTableAdapter regionTableAdapter = new NorthwindDataSetTableAdapters.RegionTableAdapter(); regionTableAdapter.Insert(5, "NorthWestern");
Check the above link for more examples.