Dropdown bind

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Mar 2009
Posts: 12
Reputation: thirumca is an unknown quantity at this point 
Solved Threads: 0
thirumca thirumca is offline Offline
Newbie Poster

Dropdown bind

 
0
  #1
Mar 30th, 2009
Hi,

how to bind dropdownlist in few seconds

I have one table in msaccess database, but this table contains 2500 records. I need to bind these records to asp.net dropdown list, but its take long time to bind the datas. so pls give any new method for binding the datas into dropdownlist with quick and few minutes.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Dropdown bind

 
0
  #2
Mar 30th, 2009
hi,

can you show u r code for retrieving data from database.
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 12
Reputation: thirumca is an unknown quantity at this point 
Solved Threads: 0
thirumca thirumca is offline Offline
Newbie Poster

Re: Dropdown bind

 
0
  #3
Mar 30th, 2009
Hi,
This is code for retrive data from database

  1. public static void Neweventsfilldd1(DropDownList dd_count,string query , string field,string valfield)
  2. {
  3. try
  4. {
  5. DataTable dt = new DataTable();
  6. OleDbDataAdapter da = new OleDbDataAdapter(query,ConnectionString);
  7. da.Fill(dt);
  8. dd_count.DataSource = dt;
  9. dd_count.DataTextField = dt.Columns[field].ToString();
  10. dd_count.DataValueField=dt.Columns[valfield].ToString();
  11. dd_count.DataBind();
  12. }
  13. catch(Exception e)
  14. {
  15. System.Diagnostics.Debug.Write(e.Message);
  16. throw;
  17. }
  18. }
Last edited by peter_budo; Mar 30th, 2009 at 1:43 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 30
Reputation: P.K.Chaudhary is an unknown quantity at this point 
Solved Threads: 5
P.K.Chaudhary P.K.Chaudhary is offline Offline
Light Poster

Re: Dropdown bind

 
0
  #4
Mar 31st, 2009
Hi,
Try using caching or ajax, these are the only two ways you can solve this problem.
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Dropdown bind

 
0
  #5
Mar 31st, 2009
hi,

you can use webservices to load data in to dropdownlist.
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 12
Reputation: thirumca is an unknown quantity at this point 
Solved Threads: 0
thirumca thirumca is offline Offline
Newbie Poster

Re: Dropdown bind

 
0
  #6
Apr 2nd, 2009
Hi,
How can we use webservice for dropdown binding? Please give the sample code for binding dropdown using webservice
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 370
Reputation: greeny_1984 is an unknown quantity at this point 
Solved Threads: 29
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz

Re: Dropdown bind

 
0
  #7
Apr 3rd, 2009
If u r query is achieved,mark the thread as solved

Live and Let Live
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 12
Reputation: thirumca is an unknown quantity at this point 
Solved Threads: 0
thirumca thirumca is offline Offline
Newbie Poster

Re: Dropdown bind

 
0
  #8
Apr 3rd, 2009
Hi,
Thanks for ur reply.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 1,181
Reputation: hollystyles will become famous soon enough hollystyles will become famous soon enough 
Solved Threads: 67
hollystyles's Avatar
hollystyles hollystyles is offline Offline
Veteran Poster

Re: Dropdown bind

 
0
  #9
Apr 3rd, 2009
What database are you using? OLE is slow but may be your only choice.

Also use a reader (forward only cursor) instead of a DataTable, it's faster for this kind of scenario.

But, consider the design. 2500 options in a drop Down List box ??? I can't think of any reason why I would want to choose from that many items in any application as a user. Consider filtering this list into sections/categories and have another drop down for the user to choose a section/category and then load only those items into the dropdown at a time.
Last edited by hollystyles; Apr 3rd, 2009 at 9:44 am.
==========================================
Yadda yadda yadda...
Web junky, fevered monkey
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 12
Reputation: thirumca is an unknown quantity at this point 
Solved Threads: 0
thirumca thirumca is offline Offline
Newbie Poster

Re: Dropdown bind

 
0
  #10
Apr 4th, 2009
hi,
Thanks for your reply
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC