1 Attachment(s)
[RESOLVED] Dataset New Row
Here is the code i am using to add a new row and update the database:
Code:
Dim DataSetNewRow As DataRow
DataSetNewRow = Database.DataSet.Tables("Policies").NewRow
DataSetNewRow.Item(1) = PolicyNumberTextbox.Text
DataSetNewRow.Item(2) = BrokerTextbox.Text
Database.DataSet.Tables("Policies").Rows.Add(DataSetNewRow)
DataAdapter.Update(Database.DataSet, "Policies")
The part highlighted in red returns the follwoing error but i cant understand why as this is the code ive used in a few other apps.