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!
>>
>>
>>
>>
>
>
>.
>

Re: find the position of an item in the middle of datarows by CT

CT
Mon Jul 28 13:18:28 CDT 2003

The binding context is your only option as it will provide you with the
requested functionality. As you state yourself, it's down to the "missing"
cursors, but you can obviously implement this yourself if you really need
it. What's the problem with the binding context?

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Haisheng Lin" <haishenglin@hotmail.com> wrote in message
news:042501c354cc$5263a730$a101280a@phx.gbl...
>
> 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!
> >>
> >>
> >>
> >>
> >
> >
> >.
> >



Re: find the position of an item in the middle of datarows by Haisheng

Haisheng
Mon Jul 28 23:23:04 CDT 2003

Could you tell me more details about how to get
the position of a specific item using binding context?
>-----Original Message-----
>The binding context is your only option as it will
provide you with the
>requested functionality. As you state yourself, it's down
to the "missing"
>cursors, but you can obviously implement this yourself if
you really need
>it. What's the problem with the binding context?
>
>--
>Carsten Thomsen
>Enterprise Development with Visual Studio .NET, UML, and
MSF
>http://www.apress.com/book/bookDisplay.html?bID=105
>"Haisheng Lin" <haishenglin@hotmail.com> wrote in message
>news:042501c354cc$5263a730$a101280a@phx.gbl...
>>
>> 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!
>> >>
>> >>
>> >>
>> >>
>> >
>> >
>> >.
>> >
>
>
>.
>