I am new to this coming from VB5.
I am getting the exception message "DataTable must be set prior to using DataView" on the first line of my code below.
What is the code I need to set the DataTable?? I am going thru this to find something in VB2012 similar to a FindNext in VB5.
Thanks for your help!!
Try
Dim custView = New DataView(_DEI_DatabaseDataSet.Tables("Customers File"), "", "[C-BuyLN]", DataViewRowState.CurrentRows)
Dim foundRows() As DataRowView = custView.FindRows(New Object() {"Rose"})
If foundRows.Length = 0 Then
Console.WriteLine("No match found.")
Else
Dim myDRV As DataRowView
For Each myDRV In foundRows
Console.WriteLine("{0}", myDRV("[C-BuyLN]").ToString())
Next
End If
Catch ex As Exception
MsgBox("Error in ""Find First"" : " + ex.Message)
End Try
I am getting the exception message "DataTable must be set prior to using DataView" on the first line of my code below.
What is the code I need to set the DataTable?? I am going thru this to find something in VB2012 similar to a FindNext in VB5.
Thanks for your help!!
Try
Dim custView = New DataView(_DEI_DatabaseDataSet.Tables("Customers File"), "", "[C-BuyLN]", DataViewRowState.CurrentRows)
Dim foundRows() As DataRowView = custView.FindRows(New Object() {"Rose"})
If foundRows.Length = 0 Then
Console.WriteLine("No match found.")
Else
Dim myDRV As DataRowView
For Each myDRV In foundRows
Console.WriteLine("{0}", myDRV("[C-BuyLN]").ToString())
Next
End If
Catch ex As Exception
MsgBox("Error in ""Find First"" : " + ex.Message)
End Try