Hi guys,

I have a dropdownlist binded to a sqldatasource and the result set contains about 394,000 serial no. This is making the page crash and i cannot mess with the table architecture. I would like to know if trhere is a way to limit the results and then retrieving more after the user has scrolled down more. I believe it could be done with sql cursor fetch and previous but i dont know how to implement it to the dropdownlist. If someone could be of help i would appreciate it.

Thanks

Recommended Answers

All 8 Replies

Is this classic asp or asp.net. I only ask because asp is the only indication in the title. It makes a difference whether we are talking about controls or html with integrated server code.

This can be done using a jquery plugin(waypoints) and ajax, i dont thing with out using AJAX or ASP.NET AJAX this cannot be acheived

Well actually is asp.net c#, i opted out with a textbox and a ajax autocomplete extender but i will look into the waypoints... I just never used jquery

Some way you need to categorize your ids, i think binding those many items to a drop down list will definitely make the page to crash down.

binding those many items to a drop down

it did but since i cannot change the database keys etc i opted out with an autocomplete extender

autocomplete extender

a textbox and a ajax autocomplete extender

this is probably your best bet.

you could try using the onscroll event (the HTML select control supports this event) to call an ajax function which will trigger your sql cursor.

But due to the sheer quantity of data you are dealing with, you might be better served to use a datalist or something with paging capability to make it easier for your users to work their way through it all.

I would like to know if trhere is a way to limit the results and then retrieving more after the user has scrolled down more.

If you've Ms-Sql server database then you may fetch limited rows from the table.

SELECT * FROM 
       ( SELECT *, ROW_NUMBER() OVER (ORDER BY ColumnName) as row FROM TableName)
        a 
       WHERE row >= 1 and row <= 10

If you're working with mysql then use LIMIT clause with SELECT statement.

Have a look at Code project article - Paging of Large Resultsets in ASP.NET

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.