V
Vayse
I have two questions on this. I'll show my code first
'**********************************************************
Dim taEvents As New AssetsDataSetTableAdapters.HTEventsTableAdapter
Dim dtEvents As New AssetsDataSet.HTEventsDataTable
taEvents.Fill(dtEvents)
Dim viewEvents As New DataView(dtEvents)
viewEvents.RowFilter = "EventDay Like 'D*'"
viewEvents.Sort = "EventDay ASC"
Dim rowView As DataRowView
Me.txtResult.Clear()
For Each rowView In viewEvents
Me.txtResult.Text = Me.txtResult.Text & rowView("EventDay")
& ": " & rowView("EventText") & vbCrLf
Next
'**********************************************************
1) Is it possible to use a strongly typed row instead of rowView above?
2) Now lets say I want to make changes as below and write back. Is this
possible using taEvents?
Dim dtFiltered As DataTable = viewEvents.ToTable()
Dim rowEvent As DataRow
For Each rowEvent In dtFiltered.Rows
rowEvent("EventText") = Me.txtNewText.Text
Next
taEvents.Update(CType(dtFiltered,
AssetsDataSet.HTEventsDataTable)) ' -> Won't work
Thanks
Vayse
'**********************************************************
Dim taEvents As New AssetsDataSetTableAdapters.HTEventsTableAdapter
Dim dtEvents As New AssetsDataSet.HTEventsDataTable
taEvents.Fill(dtEvents)
Dim viewEvents As New DataView(dtEvents)
viewEvents.RowFilter = "EventDay Like 'D*'"
viewEvents.Sort = "EventDay ASC"
Dim rowView As DataRowView
Me.txtResult.Clear()
For Each rowView In viewEvents
Me.txtResult.Text = Me.txtResult.Text & rowView("EventDay")
& ": " & rowView("EventText") & vbCrLf
Next
'**********************************************************
1) Is it possible to use a strongly typed row instead of rowView above?
2) Now lets say I want to make changes as below and write back. Is this
possible using taEvents?
Dim dtFiltered As DataTable = viewEvents.ToTable()
Dim rowEvent As DataRow
For Each rowEvent In dtFiltered.Rows
rowEvent("EventText") = Me.txtNewText.Text
Next
taEvents.Update(CType(dtFiltered,
AssetsDataSet.HTEventsDataTable)) ' -> Won't work
Thanks
Vayse