Home All Groups Group Topic Archive Search About

'Incremental Search' of data base or "Wheres the 'Seek' method

Author
11 May 2006 7:20 PM
Terry
Hi,
I am both new to .Net (coming from VB6 and DAO) and to this news group.  I
am trying to convert some code from VB6 that uses a "record set" to help the
user locate a specific record.
As the user types into a text box, the grid position changes.
example:

rs.index = "CompanyName"
..
..
..
Private Sub txtCompanyName_Changed()
rs .seek ">=", txtCompanyName.Text
..
..
..
I not only can't find a "seek" function for a table in a dataset, I can't
find any mention of an index for a table in a dataset!  Am I missing
something?  I hope the solution is not that I have to issue a new SELECT
with a sort by clause and then a loop with a move next statement!

Any help would be greatly appreciated!
Terry

Author
11 May 2006 8:33 PM
Cor Ligthert [MVP]
Terry,

If you are used to recordset, than don't try to compare them with datasets.
The datatable is the most neares.

A datatable hold datacolumns and datarows.

The datacolumns describes the items in a datarow
Every datarow has data items.

And than we have very much methods where ADO has one
There is the
DataView rowfilter
DataView find
DataTAble select
DataRowCollection find
And more

http://msdn2.microsoft.com/en-us/library/system.data.datarowcollection.find.aspx

I think that the one above meets the solution to your current problem the
most.

I hope this helps,

Cpr

Show quoteHide quote
"Terry" <TerryCL***@hotmail.com> schreef in bericht
news:uRuLCBTdGHA.564@TK2MSFTNGP02.phx.gbl...
> Hi,
> I am both new to .Net (coming from VB6 and DAO) and to this news group.  I
> am trying to convert some code from VB6 that uses a "record set" to help
> the user locate a specific record.
> As the user types into a text box, the grid position changes.
> example:
>
> rs.index = "CompanyName"
> .
> .
> .
> Private Sub txtCompanyName_Changed()
> rs .seek ">=", txtCompanyName.Text
> .
> .
> .
> I not only can't find a "seek" function for a table in a dataset, I can't
> find any mention of an index for a table in a dataset!  Am I missing
> something?  I hope the solution is not that I have to issue a new SELECT
> with a sort by clause and then a loop with a move next statement!
>
> Any help would be greatly appreciated!
> Terry
>
>
Author
12 May 2006 12:16 AM
Terry
Hi,
  I do not wish to "filter " the results, I want to position the current
row.   The 'find' method requires that I already know the value being
sought, which obviously is not the case.  For example,
when the
user type 'M' in the text box, I want the top row of the DataView to be the
first company name that starts with 'M' and when he then types a 'i' I want
the top row to be the first entry that starts with 'Mi' etc.  If no such
entry exists, the DataView would still be positioned at the first record
starting with 'M' as opposed to having an empty DataView, which would be the
result of setting a filter for the first 2 characters of company name being
"Mi".
  So, I ask again, how do I quickly "position" the datagridview?


Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:O$b6dnTdGHA.5016@TK2MSFTNGP04.phx.gbl...
> Terry,
>
> If you are used to recordset, than don't try to compare them with
> datasets. The datatable is the most neares.
>
> A datatable hold datacolumns and datarows.
>
> The datacolumns describes the items in a datarow
> Every datarow has data items.
>
> And than we have very much methods where ADO has one
> There is the
> DataView rowfilter
> DataView find
> DataTAble select
> DataRowCollection find
> And more
>
> http://msdn2.microsoft.com/en-us/library/system.data.datarowcollection.find.aspx
>
> I think that the one above meets the solution to your current problem the
> most.
>
> I hope this helps,
>
> Cpr
>
> "Terry" <TerryCL***@hotmail.com> schreef in bericht
> news:uRuLCBTdGHA.564@TK2MSFTNGP02.phx.gbl...
>> Hi,
>> I am both new to .Net (coming from VB6 and DAO) and to this news group.
>> I am trying to convert some code from VB6 that uses a "record set" to
>> help the user locate a specific record.
>> As the user types into a text box, the grid position changes.
>> example:
>>
>> rs.index = "CompanyName"
>> .
>> .
>> .
>> Private Sub txtCompanyName_Changed()
>> rs .seek ">=", txtCompanyName.Text
>> .
>> .
>> .
>> I not only can't find a "seek" function for a table in a dataset, I can't
>> find any mention of an index for a table in a dataset!  Am I missing
>> something?  I hope the solution is not that I have to issue a new SELECT
>> with a sort by clause and then a loop with a move next statement!
>>
>> Any help would be greatly appreciated!
>> Terry
>>
>>
>
>
Author
12 May 2006 4:38 AM
Cor Ligthert [MVP]
Terry,

Sorry but "postition" in Net means the place that a row has inside its
collection, which is showed or whatever.

"Sort" means to set them in a special sequence,

I cannot change the used terminology

Therefore do you need a position or do you want to show the rows in a
special sorted way.

The DataGridView has no position but has a rowindex.

Cor

Show quoteHide quote
"Terry" <TerryCL***@hotmail.com> schreef in bericht
news:uPtgRmVdGHA.3352@TK2MSFTNGP03.phx.gbl...
> Hi,
>  I do not wish to "filter " the results, I want to position the current
> row.   The 'find' method requires that I already know the value being
> sought, which obviously is not the case.  For example,
> when the
> user type 'M' in the text box, I want the top row of the DataView to be
> the first company name that starts with 'M' and when he then types a 'i' I
> want the top row to be the first entry that starts with 'Mi' etc.  If no
> such entry exists, the DataView would still be positioned at the first
> record starting with 'M' as opposed to having an empty DataView, which
> would be the result of setting a filter for the first 2 characters of
> company name being "Mi".
>  So, I ask again, how do I quickly "position" the datagridview?
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:O$b6dnTdGHA.5016@TK2MSFTNGP04.phx.gbl...
>> Terry,
>>
>> If you are used to recordset, than don't try to compare them with
>> datasets. The datatable is the most neares.
>>
>> A datatable hold datacolumns and datarows.
>>
>> The datacolumns describes the items in a datarow
>> Every datarow has data items.
>>
>> And than we have very much methods where ADO has one
>> There is the
>> DataView rowfilter
>> DataView find
>> DataTAble select
>> DataRowCollection find
>> And more
>>
>> http://msdn2.microsoft.com/en-us/library/system.data.datarowcollection.find.aspx
>>
>> I think that the one above meets the solution to your current problem the
>> most.
>>
>> I hope this helps,
>>
>> Cpr
>>
>> "Terry" <TerryCL***@hotmail.com> schreef in bericht
>> news:uRuLCBTdGHA.564@TK2MSFTNGP02.phx.gbl...
>>> Hi,
>>> I am both new to .Net (coming from VB6 and DAO) and to this news group.
>>> I am trying to convert some code from VB6 that uses a "record set" to
>>> help the user locate a specific record.
>>> As the user types into a text box, the grid position changes.
>>> example:
>>>
>>> rs.index = "CompanyName"
>>> .
>>> .
>>> .
>>> Private Sub txtCompanyName_Changed()
>>> rs .seek ">=", txtCompanyName.Text
>>> .
>>> .
>>> .
>>> I not only can't find a "seek" function for a table in a dataset, I
>>> can't find any mention of an index for a table in a dataset!  Am I
>>> missing something?  I hope the solution is not that I have to issue a
>>> new SELECT with a sort by clause and then a loop with a move next
>>> statement!
>>>
>>> Any help would be greatly appreciated!
>>> Terry
>>>
>>>
>>
>>
>
>
Author
11 May 2006 8:40 PM
Ralph
Show quote Hide quote
"Terry" <TerryCL***@hotmail.com> wrote in message
news:uRuLCBTdGHA.564@TK2MSFTNGP02.phx.gbl...
> Hi,
> I am both new to .Net (coming from VB6 and DAO) and to this news group.  I
> am trying to convert some code from VB6 that uses a "record set" to help
the
> user locate a specific record.
> As the user types into a text box, the grid position changes.
> example:
>
> rs.index = "CompanyName"
> .
> .
> .
> Private Sub txtCompanyName_Changed()
> rs .seek ">=", txtCompanyName.Text
> .
> .
> .
> I not only can't find a "seek" function for a table in a dataset, I can't
> find any mention of an index for a table in a dataset!  Am I missing
> something?  I hope the solution is not that I have to issue a new SELECT
> with a sort by clause and then a loop with a move next statement!
>
> Any help would be greatly appreciated!
> Terry
>

--
<response type="generic" language="VB.Net">
This newsgroup is for users of Visual Basic version 6.0
and earlier and not the misleadingly named VB.Net
or VB 200x.  Solutions, and often even the questions,
for one platform will be meaningless in the other.
When VB.Net was released Microsoft created new newsgroups
devoted to the new platform so that neither group of
developers need wade through the clutter of unrelated
topics.  Look for newsgroups with the words "dotnet",
"framework", or "vsnet" in their name.

For the news.microsoft.com news server try these:

news://msnews.microsoft.com/
   microsoft.public.dotnet.languages.vb.upgrade
   microsoft.public.dotnet.languages.vb.controls
   microsoft.public.dotnet.languages.vb.data
   microsoft.public.dotnet.framework.adonet
   microsoft.public.dotnet.framework.windowsforms.controls
   microsoft.public.dotnet.framework.windowsforms.databinding
</response>