Hi,
If you are using a DataSet with a DataTable, you can use the Find Method for the Row Collection to find a row based on a specific value.
Here a I have 2 examples, one using the primary key, and the other using the SelectMethod for a wider criteria.
Dim m_Table As DataTable = DataSetLoader.LoadDataSet(SeleccionarArchivo).Tables(0)
m_Table.PrimaryKey = New DataColumn() {m_Table.Columns("CustomerID")}
Dim m_dr As DataRow = m_Table.Rows.Find(txtID.Text)
If m_dr IsNot Nothing Then
CargarDataRow(m_dr)
End If
---------------------------------------------------------------------------------------------------------------
Dim m_Table As DataTable = DataSetLoader.LoadDataSet(SeleccionarArchivo).Tables(0)
Dim drs() As DataRow = m_Table.Select("LastName Like '%JAS' ")
If drs IsNot Nothing Then
For Each dr As DataRow In drs
CargarDataRow(dr)
Next
End If
Best Regards
|