I have a table with two columns:
prod_id (primary key), prod_name.

I filled my dataset with this table and bind
two textboxs to the two columns.
I am trying to search a specific product
using its prod_name and I want to know
the position of this row in datatable.rows.

How can I do it?

Thank you!

Re: Search in Dataset by Rahul

Rahul
Sun Jul 27 05:35:00 CDT 2003

There might be a functionality to do this, but I have seen people work
around very easily by putting another column called "rowindex" which
keeps the index stored there. [inefficient, but works]

Rahul Singh

anant systems, inc. | making information work for you

anantsystems.net | ioserver.net [Developer and Business .NET Hosting]



"Haisheng Lin" <haishenglin@hotmail.com> wrote in message
news:26aa01c353ff$bf1c1380$a001280a@phx.gbl...
> I have a table with two columns:
> prod_id (primary key), prod_name.
>
> I filled my dataset with this table and bind
> two textboxs to the two columns.
> I am trying to search a specific product
> using its prod_name and I want to know
> the position of this row in datatable.rows.
>
> How can I do it?
>
> Thank you!
>
>
>
>



Re: Search in Dataset by Haisheng

Haisheng
Mon Jul 28 00:49:31 CDT 2003

But users need to add and deletes products.
You mean I have to keep track of these indexes?

In vb6, I use adodc and bind the fields to textbox.text.
If I need to find the specific item, I just use
adodc.recordset.find, then the cursor will move to
the first occurence and textbox.text will show the
the item you need. But in ado.net, there is no cursor in
dataset. You have to use the position in bindcontext.
If you just need to go through items one by one, that is
ok, you just add one or subtract one from the position.
But if you need to find an item in the middle,
how can you know the position you need to move to?
Do I need to implement those search algorithems myself?



>-----Original Message-----
>There might be a functionality to do this, but I have
seen people work
>around very easily by putting another column
called "rowindex" which
>keeps the index stored there. [inefficient, but works]
>
>Rahul Singh
>
>anant systems, inc. | making information work for you
>
> anantsystems.net | ioserver.net [Developer and
Business .NET Hosting]
>
>
>
>"Haisheng Lin" <haishenglin@hotmail.com> wrote in message
>news:26aa01c353ff$bf1c1380$a001280a@phx.gbl...
>> I have a table with two columns:
>> prod_id (primary key), prod_name.
>>
>> I filled my dataset with this table and bind
>> two textboxs to the two columns.
>> I am trying to search a specific product
>> using its prod_name and I want to know
>> the position of this row in datatable.rows.
>>
>> How can I do it?
>>
>> Thank you!
>>
>>
>>
>>
>
>
>.
>