jdy0803
Well-known member
I found that ADO's AddNew equivalent to ADO.NET is DataTable's NewRow method.
So I made code like this.
But I can't relate existing connection object to the DataSet or DataTable.
Here is my code.
-------------------------------------------------------
Dim ds As DataSet = New DataSet()
' Get the Data Table
Dim dt As DataTable = ds.Tables("patient")
Dim dr As DataRow = dt.NewRow()
' Set all columns
dr("patient_id") = 6
dr("first_name") = "Thomas"
dr("last_name") = "Edison"
' Add to the Rows collection
ds.Tables("patient").Rows.Add(dr)
ds.Dispose()
So I made code like this.
But I can't relate existing connection object to the DataSet or DataTable.
Here is my code.
-------------------------------------------------------
Dim ds As DataSet = New DataSet()
' Get the Data Table
Dim dt As DataTable = ds.Tables("patient")
Dim dr As DataRow = dt.NewRow()
' Set all columns
dr("patient_id") = 6
dr("first_name") = "Thomas"
dr("last_name") = "Edison"
' Add to the Rows collection
ds.Tables("patient").Rows.Add(dr)
ds.Dispose()