Re: How to get a row from DataView that has an attribute with a particular value

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Miha Markic [MVP C#] (miha)
Date: 05/28/04


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
>


Relevant Pages

  • Re: How to get a row from DataView that has an attribute with a particular value
    ... To use the RowFilter use this. ... 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 ... query that selects that specific row and fill the DataSet object with that ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Record Lookup
    ... The problem is that a novice can ask more difficult questions than somebody who knows what he wants. ... primary key in the table to the field that I wanted to use for the search ... criteria and that didn't work. ... >>> a single Access database table and return the value of one field ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Record Lookup
    ... Patrice, thank you for your comments and effort. ... primary key in the table to the field that I wanted to use for the search ... criteria and that didn't work. ... Keep in mind.....I am a NOVICE programmer, so you will have to spell it ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Record Lookup
    ... Number or First Name or Last Name or any criteria field I choose and return ... The problem is that a novice can ask more difficult questions than somebody ... primary key in the table to the field that I wanted to use for the search ... a single Access database table and return the value of one field ...
    (microsoft.public.dotnet.languages.vb)
  • generate random number
    ... I already have a form that populates the orders table, ... this field also is the primary key and I cant use autogen because they ... plenty, but this didnt work, I am kind of a novice and not sure how or where ...
    (microsoft.public.access.formscoding)