Slow to add many items to AdxCmdBarDrpDwn

Add-in Express™ Support Service
That's what is more important than anything else

Slow to add many items to AdxCmdBarDrpDwn
 
Matt Driver


Matt


Posts: 152
Joined: 2004-08-17
Hi

I am populating a AdxCmdBarDrpDwn from SQL with around 16000 objects (a list of companies for the user to choose) this takes .12 seconds to run in .NET as code below. But when I then enable the line:


// AdxCmdBarDrpDwn_EX.Items.Add(row[0].ToString());

in the below example it takes 2 hours to run.

Is their anything I can do to speed up the population fo the AdxCmdBarDrpDwn_EX.Items ?

matt


try
{
string select = "select Company_Name from Company" ;
string source = @"integrated security=SSPI;data source=UK-W2K3S-PIVOT;persist security info=False;initial catalog=i2_Production_ED";
using ( SqlConnection conn = new SqlConnection ( source ) )
{
SqlDataAdapter da = new SqlDataAdapter ( select , conn ) ;
DataSet ds = new DataSet ( ) ;
da.Fill ( ds , "Customers" ) ;
foreach ( DataRow row in ds.Tables["Customers"].Rows )
// AdxCmdBarDrpDwn_EX.Items.Add(row[0].ToString());


}
conn.Close ( ) ;
}

catch ( Exception e )
{
conn.Close ( ) ;
}
Posted 11 Jul, 2006 08:54:51 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Matt.

I am afraid you will have to use a .NET form with a combo box control to add all items as fast as possible. It takes 4-6 seconds on my PC.
Posted 11 Jul, 2006 09:59:03 Top
Matt Driver


Matt


Posts: 152
Joined: 2004-08-17
Thanks

Matt
Posted 11 Jul, 2006 10:00:48 Top