| | |
Dropdown bind
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2009
Posts: 12
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Mar 2009
Posts: 12
Reputation:
Solved Threads: 0
Hi,
This is code for retrive data from database
This is code for retrive data from database
ASP.NET Syntax (Toggle Plain Text)
public static void Neweventsfilldd1(DropDownList dd_count,string query , string field,string valfield) { try { DataTable dt = new DataTable(); OleDbDataAdapter da = new OleDbDataAdapter(query,ConnectionString); da.Fill(dt); dd_count.DataSource = dt; dd_count.DataTextField = dt.Columns[field].ToString(); dd_count.DataValueField=dt.Columns[valfield].ToString(); dd_count.DataBind(); } catch(Exception e) { System.Diagnostics.Debug.Write(e.Message); throw; } }
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.
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.
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.
![]() |
Similar Threads
- Without PostBack bind dropdownlist to textbox (C#)
- how to bind dropdown to a datasource (C#)
- How to using diferrent dropdown for the time(c#) (ASP.NET)
- drop down list selected index change doesn't work in mozilla (ASP.NET)
- Dropdown list in ASP.NET - How to get value selected (ASP.NET)
- Concate Columns in DropDown list (ASP.NET)
- onclick dropdown event (ASP.NET)
- Dropdown box in Python (Python)
- SqlDataAdapter bind to a listbox (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: IIS Server behavious while handing multiple requests simultaneously
- Next Thread: Combination of Asp.Net and Php
| Thread Tools | Search this Thread |
.net activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# cac checkbox click commonfunctions control css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownlist dynamic dynamically edit embeddingactivexcontrol expose fileuploader fill findcontrol flash formatdecimal formview gridview gudi iframe iis javascript listbox login microsoft mono mouse mssql multistepregistration news novell numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers






