Add New

  • Thread starter Thread starter Paul Ilacqua
  • Start date Start date
P

Paul Ilacqua

Is there something similar to the
rs.Addnew
....
....
rs.update
from ADO in ADO.Net on an Access or SQL Server database.

Paul
 
Paul,
look at the DataSet, the DataTable and the DataRow
The DataSet provides more functionality than the old ADO RecordSet.
A DataSet can hold multiple DataTables (as well as relationships)

something like:
Assuming an existing DataSet

Dim MyDataTable As DataTable
Dim MyDataRow as DataRow

MyDataTable = MyDataSet.Tables("MyTable")
MyDataRow = MyDataTable.NewRow
MyDataRow("MyField1") = 1
MyDataRow("MyField2") = "Test"
MyDataTable.Rows.Add(MyDataRow)

Doug
 
Paul said:
After I add rows how do I resynch it back to the database?

Call the Update method on the DataAdapter object which you used to fill your
DataTable. Pass the DataTable to it as the parameter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top