Re: How to get a row from DataView that has an attribute with a particular value
From: Miha Markic [MVP C#] (miha)
Date: 05/28/04
- Next message: Mike: "Re: 150+ columns SQL table???"
- Previous message: Mike: "Re: 150+ columns SQL table???"
- In reply to: Novice: "How to get a row from DataView that has an attribute with a particular value"
- Next in thread: William Ryan eMVP: "Re: How to get a row from DataView that has an attribute with a particular value"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 28 May 2004 18:09:19 +0200
DataView.Find method will search using sort order defined by DataView.Sort.
Does this help?
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com
"Novice" <6tc1ATqlinkDOTqueensuDOTca> wrote in message
news:D821C2BB-CA1F-429F-B599-223EC1F286D5@microsoft.com...
> Hi all, I'm trying to get a row/record (from a table) whose primary key
attribute has a particular value from a DataView.
>
> So, for example:
> Dim parentRows As System.Data.DataView
> Dim childRows As System.Data.DataView
> Dim currentParentRow As
System.Data.DataRowView
>
> I get all of the rows back from the table using the DataSet.
> parentRows.Table =
Me.objSomeDataSet.Tables("some_table")
> Then I use the following:
> currentParentRow =
parentRows(selectedRowIndex)
> However, there is no guarantee that the rows will be ordered on the
primary key in the database - and in this case they are not.
>
> Is there a way to use the parentRows DataView to get a record/row whose
primary key attribute has a particular value? Or should I just use a SQL
query that selects that specific row and fill the DataSet object with that
data instead of just all the rows from the table.
>
> Thanks,
> Novice
>
- Next message: Mike: "Re: 150+ columns SQL table???"
- Previous message: Mike: "Re: 150+ columns SQL table???"
- In reply to: Novice: "How to get a row from DataView that has an attribute with a particular value"
- Next in thread: William Ryan eMVP: "Re: How to get a row from DataView that has an attribute with a particular value"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|