DataSet
I have a Dataset that I want to add a column to if a value in the Dataset is a certain value.
Dim da As New OleDbDataAdapter(strSQL, strConn)
Dim myDataSet As New DataSet
da.Fill(myDataSet, "dtAnswers")
Dim r As DataRow
Dim myDataTable As DataTable = myDataSet.Tables("dtAnswers")
myDataTable.Columns.Add(New DataColumn("thenotes", GetType(String)))
Dim i As Integer
For Each r In myDataSet.Tables("dtAnswers").Rows
Response.Write(r("statusid") & " ")
For i = 0 To myDataTable.Rows.Count - 1
myDataTable.Rows(i)("thenotes") = r("statusid")
Next
Next
The response.write is displaying the correct statusid(s) but I can't figure out how to add that to the column rows. It currently prints the very last ID on every row.
|