943,929 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 2959
  • ASP.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 30th, 2009
0

Dropdown bind

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thirumca is offline Offline
12 posts
since Mar 2009
Mar 30th, 2009
0

Re: Dropdown bind

hi,

can you show u r code for retrieving data from database.
Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007
Mar 30th, 2009
0

Re: Dropdown bind

Hi,
This is code for retrive data from database

ASP.NET Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thirumca is offline Offline
12 posts
since Mar 2009
Mar 31st, 2009
0

Re: Dropdown bind

Hi,
Try using caching or ajax, these are the only two ways you can solve this problem.
Reputation Points: 10
Solved Threads: 5
Light Poster
P.K.Chaudhary is offline Offline
30 posts
since Mar 2009
Mar 31st, 2009
0

Re: Dropdown bind

hi,

you can use webservices to load data in to dropdownlist.
Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007
Apr 2nd, 2009
0

Re: Dropdown bind

Hi,
How can we use webservice for dropdown binding? Please give the sample code for binding dropdown using webservice
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thirumca is offline Offline
12 posts
since Mar 2009
Reputation Points: 25
Solved Threads: 29
Posting Whiz
greeny_1984 is offline Offline
372 posts
since Apr 2007
Apr 3rd, 2009
0

Re: Dropdown bind

Hi,
Thanks for ur reply.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thirumca is offline Offline
12 posts
since Mar 2009
Apr 3rd, 2009
0

Re: Dropdown bind

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.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
hollystyles is offline Offline
1,181 posts
since Feb 2005
Apr 4th, 2009
0

Re: Dropdown bind

hi,
Thanks for your reply
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thirumca is offline Offline
12 posts
since Mar 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: windows authentication
Next Thread in ASP.NET Forum Timeline: Combination of Asp.Net and Php





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC