I normally add data using classes, but I am building a prototype and using data sources in the project. The data source is called 'ProgramDataSet' which contains all the tables for the application. In this example I am trying to add a new row for each cutting from a plant, with the number of plants to start stored in the variable 'starts'.
This should be simple, but none of the code samples I found showed how to do this in .Net 4.5 and VB 2012.
The code obviously doesn't work, but hopefully you will understand what I'm trying to do and present some sample code to do this correctly. Thanks!
Dim starts As Integer = CInt(Me.NumberOfStartsTextBox.Text)
Dim r As DataRow = ProgramDataSet.PlantsRow
For x As Integer = 1 To starts
r.StrainCode = Me.StrainCodeComboBox.Text
r.StartDate = Me.StartDateDateTimePicker.Value
r.Description = Me.DescriptionTextBox.Text