DataTable.Rows.Find

  • Thread starter Thread starter Sunny
  • Start date Start date
S

Sunny

Hi,
I have created DataSet and DataTable. I want to be able to locate a row in
that table by looking for a particular value in a field. Lets say I have
Field1, Field2 and Field3.
Sometimes I need to find a rows, for which Field1 = 15, and sometimes I need
to find rows where Field2 = "something".
As far as I read docs about Rows.Find method, I need a keys. OK, I have
created a keys in the table, lets say Key1 for Field1 and Key2 for Field2.
And .. I don't know how to use them, as in docs I have to pass to Find
method and object or array of objects with values. But how I specify that
I'll use one or another key, i.e. which field I'm searching?

Thanks
Sunny
 
Thanks, it works for me :)
Sunny

-zir- said:
Try: DataTable.Select()
You dont need a key for this, method returns rows matching criteria.

-zir
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top