Is there any way to append some items to List box, without retrieving all items through AJAX?

Discussion in 'ASP .Net' started by Anjan Bhowmik, Feb 14, 2008.

  1. Suppose i have a multi-select list box which loads data from a table in a
    SQL Server 2005 Database.

    This list box loads all rows from the table, which has around 2000 rows. So
    when databinding all 2000 rows will be fetched from database and bound to
    the List box. Which is fairly a time consuming process.

    Now when i insert 5 more values into the database and call list box's
    DataBind() method, it will return all 2005 rows. So, continuing this process
    it will take more and more time to load and manipulate data through the list
    box, As daily i would have to add 10-15 rows of data to the table.

    My question is, Can i add the newly added rows to the existing items of the
    list box by any means using AJAX? That means if i add 1 row to the table, i
    want to fetch that single row and then add it to the list box's existing
    items. This can improve the performance of the system very much.

    But the question is "IS IT POSSIBLE?"
    Anjan Bhowmik, Feb 14, 2008
    #1
    1. Advertising

  2. RE: Is there any way to append some items to List box, without retriev

    you could change your SELECT query to fetch records with ID greater than the
    last item in the listbox and iterate over the DataTable returned adding each
    item to the listbox.items collection

    --
    Misbah Arefin



    "Anjan Bhowmik" wrote:

    > Suppose i have a multi-select list box which loads data from a table in a
    > SQL Server 2005 Database.
    >
    > This list box loads all rows from the table, which has around 2000 rows. So
    > when databinding all 2000 rows will be fetched from database and bound to
    > the List box. Which is fairly a time consuming process.
    >
    > Now when i insert 5 more values into the database and call list box's
    > DataBind() method, it will return all 2005 rows. So, continuing this process
    > it will take more and more time to load and manipulate data through the list
    > box, As daily i would have to add 10-15 rows of data to the table.
    >
    > My question is, Can i add the newly added rows to the existing items of the
    > list box by any means using AJAX? That means if i add 1 row to the table, i
    > want to fetch that single row and then add it to the list box's existing
    > items. This can improve the performance of the system very much.
    >
    > But the question is "IS IT POSSIBLE?"
    >
    Misbah Arefin, Feb 14, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    409
    Steven Bethard
    Mar 3, 2006
  2. HYRY
    Replies:
    10
    Views:
    586
    Bruno Desthuilliers
    Sep 26, 2007
  3. Henrik
    Replies:
    1
    Views:
    416
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
  4. HALLES
    Replies:
    17
    Views:
    269
    Thomas 'PointedEars' Lahn
    Jun 2, 2005
  5. Replies:
    0
    Views:
    116
Loading...

Share This Page