best way to find row in Dataview

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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 ?
 
Back
Top