best way to find row in Dataview

G

Guest

i have a Dataview with 10 rows.Each row has a different "category" value, but this is not the primary key. to access a particular category i do the following
dva.Sort="CategoryID"
DataRowView[] drv= dva.FindRows("2")

the array will always be 1 row so ill get the row i need. howver, is creating this array the best way ?

thank
 
M

Miha Markic [MVP C#]

Hi,

DataView.Find perhaps?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

subt said:
i have a Dataview with 10 rows.Each row has a different "category" value,
but this is not the primary key. to access a particular category i do the
following:
dva.Sort="CategoryID";
DataRowView[] drv= dva.FindRows("2");

the array will always be 1 row so ill get the row i need. howver, is
creating this array the best way ?
 

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

Top