PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Combo Box loading speed

 
 
Aaron
Guest
Posts: n/a
 
      24th Nov 2003
I have a pair of databound combo boxes on my page. I am
quite unhappy with the time it takes to load them. Is
there a way to speed it up by coding it manually or
is .datasource, .valuemember .displaymember the best?

Thanks,
Aaron
 
Reply With Quote
 
 
 
 
Alex Yakhnin [MVP]
Guest
Posts: n/a
 
      24th Nov 2003
What's the data source for your combobox?
How many records are you loading?

--
Alex Yakhnin .NET CF MVP
http://www.intelliprog.com
http://www.opennetcf.org


>-----Original Message-----
>I have a pair of databound combo boxes on my page. I am
>quite unhappy with the time it takes to load them. Is
>there a way to speed it up by coding it manually or
>is .datasource, .valuemember .displaymember the best?
>
>Thanks,
>Aaron
>.
>

 
Reply With Quote
 
Alex Yakhnin [MVP]
Guest
Posts: n/a
 
      24th Nov 2003
I guess I forgot to ask you on how many records in the
table you're retreiving records from, but regardless make
sure that you have indexes on the fields you using in the
where clause.

-Alex

>-----Original Message-----
>The datasource is a datatable from the local SQL CE DB.
>I am loading about 100 max in each combo. Takes about 20-
>30 secs:
>
>mysql = "select '0' as id, ' --All-- ' as name from misc
>union select id, name from company where accessmfg=1 or
>alarmmfg=1 or cctvmfg=1 or firemfg=1 or powermfg=1 order
>by name"
> sqlCommand.CommandText = mysql
> sqlDA = New SqlCeDataAdapter(sqlCommand)
> sqlDA.Fill(sqlDS, "company")
>
> cmbCategory.DataSource = sqlDS.Tables(0)
> cmbCategory.DisplayMember = "proposalcategory"
> cmbCategory.ValueMember = "id"
>
> Me.cmbMfg.DataSource = sqlDS.Tables(1)
> cmbMfg.DisplayMember = "name"
> cmbMfg.ValueMember = "id"
>
>
>>-----Original Message-----
>>What's the data source for your combobox?
>>How many records are you loading?
>>
>>--
>>Alex Yakhnin .NET CF MVP
>>http://www.intelliprog.com
>>http://www.opennetcf.org
>>
>>
>>>-----Original Message-----
>>>I have a pair of databound combo boxes on my page. I

>am
>>>quite unhappy with the time it takes to load them. Is
>>>there a way to speed it up by coding it manually or
>>>is .datasource, .valuemember .displaymember the best?
>>>
>>>Thanks,
>>>Aaron
>>>.
>>>

>>.
>>

>.
>

 
Reply With Quote
 
marcmc
Guest
Posts: n/a
 
      25th Nov 2003
Use a datareader, much much faster!

Private Function PopulateCombo1()

sbStatbar.Text = "Loading Comment Defaults"
sbStatbar.Refresh()

Dim strSQL As String = "Select Col1 FROM Table"
Dim cmdSelect As SqlCeCommand = New SqlCeCommand(strSQL,
MasterDBconnection)
cmdSelect.CommandType = CommandType.Text

Try
Dim dtr As SqlCeDataReader = cmdSelect.ExecuteReader
(CommandBehavior.Default)
While (dtr.Read()) ' Populate Comment type combo
cmbCombo1.Items.Add(dtr.GetString(0))
End While
dtr.Close()
dtr.Dispose()

Catch ex As SqlCeException
SQLCEFuncErrorName(ex)
End Try

sbStatbar.Text = "Combo Loaded."
sbStatbar.Refresh()

End Function

 
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
Help!! Error 3265, loading from combo bx to combo bx & to txt box mju Microsoft Access 0 11th Aug 2009 03:48 PM
FE/BE loading speed Slez via AccessMonster.com Microsoft Access Forms 9 13th Feb 2007 07:36 PM
Loading speed Thomas Scheiderich Microsoft ASP .NET 1 31st Aug 2004 08:05 AM
How to speed up the loading of XP? =?Utf-8?B?TTFBMQ==?= Windows XP General 1 25th Mar 2004 06:49 AM
loading speed ... Lloyd Dupont Microsoft Dot NET Compact Framework 3 13th Jan 2004 01:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:47 PM.