Rows.Find ????

  • Thread starter Thread starter Saeid Azish
  • Start date Start date
S

Saeid Azish

Hi all,


Does anyone know how I can implement something equal to
the following code in ADO.Net (VB.Net)

ADODC1.Recordset.Find "FirstName Like 'A%'"


I have tried Rows.Find, Rows.Select,
DefaultView.RowFilter but no chance. Any help appreciated.


Thanks, Saeid
 
Dim drFirstName as DataRow
Dim s as String = "FirstName Like '%" & First_Name & "%'"
drFirstName = myDataTable.Select(s)
 
Hi,

Thanks both for the answer but how can I move record's
pointer to this row?

Saeid
 
Hi,

Thanks both for the answer but how can I move record's
pointer to this row?

Saeid


There is no such thing as a row pointer in ADO.NET DataSet/ DataTable.
When you call Select it returns a new array of DataRow objects that match
the filter. So iterate the entire array, because they all match. The
first row that matches the criteria is "0"!

--
Michael Lang, MCSD
See my .NET open source projects
http://sourceforge.net/projects/colcodegen (simple code generator)
http://sourceforge.net/projects/dbobjecter (database app code generator)
http://sourceforge.net/projects/genadonet ("generic" ADO.NET)
 
Back
Top