DataTable.Rows.Find

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sunny

    #1

    DataTable.Rows.Find

    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


  • Sunny

    #2
    Re: DataTable.Rows. Find

    Thanks, it works for me :)
    Sunny

    "-zir-" <mail@zironline .com> wrote in message
    news:u2xnQjwcDH A.1728@TK2MSFTN GP09.phx.gbl...[color=blue]
    > Try: DataTable.Selec t()
    > You dont need a key for this, method returns rows matching criteria.
    >
    > -zir
    >
    > "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
    > news:e6Xg5bwcDH A.1272@TK2MSFTN GP12.phx.gbl...[color=green]
    > > Hi,
    > > I have created DataSet and DataTable. I want to be able to locate a row[/color][/color]
    in[color=blue][color=green]
    > > 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[/color]
    > need[color=green]
    > > 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[/color][/color]
    Field2.[color=blue][color=green]
    > > 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[/color][/color]
    that[color=blue][color=green]
    > > I'll use one or another key, i.e. which field I'm searching?
    > >
    > > Thanks
    > > Sunny
    > >
    > >[/color]
    >
    >[/color]


    Comment

    Working...