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.

Hi,
This is code for retrive data from database

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;
			}
		}

Hi,
How can we use webservice for dropdown binding? Please give the sample code for binding dropdown using webservice

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.

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.

ans:

Use AJEX extension toolbox in which update panel try to put your dropdown list other inline codings are same.This will be faster and you can only work in ASP.Net 2.0 and above version

This article has been dead for over six months. Start a new discussion instead.