PC Review


Reply
Thread Tools Rate Thread

Autocomplete with big lookup table

 
 
Andrus
Guest
Posts: n/a
 
      15th Feb 2007
I'm creating a database Winforms application using VCS Express 2005

I have some large lookup tables (may be up to 500000 records) which
contains name and id and are stored in sql server.

I need to create single line combobox style control which:

1. Allows to type first characters in name
2. Auto-completes entered data by using first match
3. Allows to open picklist based by entered data and select name

I tried to use Combobox with lookup table.
I can set combobox autocomplete source to lookup table and autocomplete
window shows matches very well.

Lookup parts table is big, it takes a lot of time to load the
data source.

I think I need virtual combobox control with autocomplete and selection from
list.

Is is not reasonable to load whole table as combobox lookup table during
combobox
creation like ms doc sample recommends.


I have found 2 possibilities:

1. Add some code to combobox events to implement virtual mode. Is this
possible ?

2. Create textbox, selection button and use (virtual?) DataGridView to
emulate virtual dropdown list. In this case I must create UI in code
also.

Which way is better ?
Where to find more information about this ?

Andrus.


 
Reply With Quote
 
 
 
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      15th Feb 2007
Hi,


>
> I have found 2 possibilities:
>
> 1. Add some code to combobox events to implement virtual mode. Is this
> possible ?
>
> 2. Create textbox, selection button and use (virtual?) DataGridView to
> emulate virtual dropdown list. In this case I must create UI in code
> also.
>
> Which way is better ?
> Where to find more information about this ?


500K rows are WAY too much, you need to look for another way of displaying
the info.


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      15th Feb 2007
I think what you want to do here is handle the keypress event, and after
there are at least 2 or 3 letters typed, you would use this as a filter in
the WHERE clause of your SQL Statement to return a small matching subset, and
bind this to your control.
There are a number of implementations of this for both Windows Forms and
ASP.NET, you can find them easily with a well-constructed google or live.com
search.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




"Andrus" wrote:

> I'm creating a database Winforms application using VCS Express 2005
>
> I have some large lookup tables (may be up to 500000 records) which
> contains name and id and are stored in sql server.
>
> I need to create single line combobox style control which:
>
> 1. Allows to type first characters in name
> 2. Auto-completes entered data by using first match
> 3. Allows to open picklist based by entered data and select name
>
> I tried to use Combobox with lookup table.
> I can set combobox autocomplete source to lookup table and autocomplete
> window shows matches very well.
>
> Lookup parts table is big, it takes a lot of time to load the
> data source.
>
> I think I need virtual combobox control with autocomplete and selection from
> list.
>
> Is is not reasonable to load whole table as combobox lookup table during
> combobox
> creation like ms doc sample recommends.
>
>
> I have found 2 possibilities:
>
> 1. Add some code to combobox events to implement virtual mode. Is this
> possible ?
>
> 2. Create textbox, selection button and use (virtual?) DataGridView to
> emulate virtual dropdown list. In this case I must create UI in code
> also.
>
> Which way is better ?
> Where to find more information about this ?
>
> Andrus.
>
>
>

 
Reply With Quote
 
pfc_sadr@hotmail.com
Guest
Posts: n/a
 
      15th Feb 2007
go to the first day of the next month and subtract one.

it's really not that complex


Public Function DaysLeftInMonth(DIn as Date) as Integer
'Dim DOut as Date
'DOut = DateSerial(Month(DIn), 1, Year(Din) - 1
'DaysLeftInMonth = DateDiff(d, DIn, Dout)
DaysLeftInMonth = DateDiff(d, DIn, DateSerial(Month(DIn), 1, Year(Din)
- 1)


End Function


On Feb 15, 11:48 am, "Andrus" <kobrule...@hot.ee> wrote:
> I'm creating a database Winforms application using VCS Express 2005
>
> I have some large lookup tables (may be up to 500000 records) which
> contains name and id and are stored in sql server.
>
> I need to create single line combobox style control which:
>
> 1. Allows to type first characters in name
> 2. Auto-completes entered data by using first match
> 3. Allows to open picklist based by entered data and select name
>
> I tried to use Combobox with lookup table.
> I can set combobox autocomplete source to lookup table and autocomplete
> window shows matches very well.
>
> Lookup parts table is big, it takes a lot of time to load the
> data source.
>
> I think I need virtual combobox control with autocomplete and selection from
> list.
>
> Is is not reasonable to load whole table as combobox lookup table during
> combobox
> creation like ms doc sample recommends.
>
> I have found 2 possibilities:
>
> 1. Add some code to combobox events to implement virtual mode. Is this
> possible ?
>
> 2. Create textbox, selection button and use (virtual?) DataGridView to
> emulate virtual dropdown list. In this case I must create UI in code
> also.
>
> Which way is better ?
> Where to find more information about this ?
>
> Andrus.



 
Reply With Quote
 
Andrus
Guest
Posts: n/a
 
      16th Feb 2007
> 500K rows are WAY too much, you need to look for another way of
> displaying the info.


Thank you.
I'm not planning to load all data since user actually looks only very small
part of data.

I think I need a simple approach: autocomplete reads first match from sql
server.
Opening picklist shows and reads first 10 matched from server.
Scrolling in pick list reads next 10 records etc.

This works probably fast even without caching.

Do you have anyidea how to implement such combo ?
My major issue is which event I should capture in combobox or how to use
virtual grid for this.
I havent found any such sample.

Andrus


 
Reply With Quote
 
Andrus
Guest
Posts: n/a
 
      16th Feb 2007
Thank you.

..NET combox has autosuggest feature.
I think I can use this. In this case there is no need to implement
autocomplete in my code.

In thi case I need to capture autosuggest not found event and in this event
read matching row from sql server.

I searched google.com and live.com for a keywords "c# combobox" and looked
for results. I read all combobox arcticles from codeproject.com

Most result describe creating auto-complete and multi-column combobox.

I havent found any which describes creating virtual combobox or similar
control.

Which keywords I should use to search or where to find information about
creating such control ?

Andrus.


"Peter Bromberg [C# MVP]" <(E-Mail Removed)> wrote in
message news:274DF04B-E71B-4A98-8953-(E-Mail Removed)...
>I think what you want to do here is handle the keypress event, and after
> there are at least 2 or 3 letters typed, you would use this as a filter in
> the WHERE clause of your SQL Statement to return a small matching subset,
> and
> bind this to your control.
> There are a number of implementations of this for both Windows Forms and
> ASP.NET, you can find them easily with a well-constructed google or
> live.com
> search.
> Peter
>
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
>
>
> "Andrus" wrote:
>
>> I'm creating a database Winforms application using VCS Express 2005
>>
>> I have some large lookup tables (may be up to 500000 records) which
>> contains name and id and are stored in sql server.
>>
>> I need to create single line combobox style control which:
>>
>> 1. Allows to type first characters in name
>> 2. Auto-completes entered data by using first match
>> 3. Allows to open picklist based by entered data and select name
>>
>> I tried to use Combobox with lookup table.
>> I can set combobox autocomplete source to lookup table and autocomplete
>> window shows matches very well.
>>
>> Lookup parts table is big, it takes a lot of time to load the
>> data source.
>>
>> I think I need virtual combobox control with autocomplete and selection
>> from
>> list.
>>
>> Is is not reasonable to load whole table as combobox lookup table during
>> combobox
>> creation like ms doc sample recommends.
>>
>>
>> I have found 2 possibilities:
>>
>> 1. Add some code to combobox events to implement virtual mode. Is this
>> possible ?
>>
>> 2. Create textbox, selection button and use (virtual?) DataGridView to
>> emulate virtual dropdown list. In this case I must create UI in code
>> also.
>>
>> Which way is better ?
>> Where to find more information about this ?
>>
>> Andrus.
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoComplete in Lookup Column =?Utf-8?B?ZW1jaDYy?= Microsoft Access 3 3rd Apr 2007 08:34 PM
Lookup field versus lookup table?? and sorting?? =?Utf-8?B?SlIgSGVzdGVy?= Microsoft Access Database Table Design 1 4th Nov 2005 08:39 PM
Need to add to the lookup table from a form lookup field (Access) =?Utf-8?B?RG9nZ2Vy?= Microsoft Access Forms 0 13th Sep 2005 05:47 PM
Pivot table doing a lookup without using the lookup function? =?Utf-8?B?TkdBU0dFTEk=?= Microsoft Excel Misc 0 2nd Aug 2005 05:08 AM
Forcing autocomplete to lookup from a range of cells Nick Hebb Microsoft Excel Programming 2 20th May 2005 11:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 AM.