Results 1 to 2 of 2

Thread: [RESOLVED] Dataset New Row

Threaded View

  1. #1

    Thread Starter
    Addicted Member mouse88's Avatar
    Join Date
    Mar 2009
    Location
    South Wales, United Kingdom
    Posts
    225

    Resolved [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.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width