<asp:listbox> control

Results 1 to 2 of 2

Thread: <asp:listbox> control

  1. #1
    Join Date
    Dec 1969

    Default <asp:listbox> control

    My table looks like this<BR><BR>tblList<BR><BR>LID¬*¬*¬*ListDesc<BR>1¬ *¬*¬*¬*¬*¬*UK<BR>1¬*¬*¬*¬*¬*¬*USA<BR>1¬*¬*¬*¬*¬*¬* India<BR>1¬*¬*¬*¬*¬*¬*Japan<BR>1¬*¬*¬*¬*¬*¬*Singap ore<BR>2¬*¬*¬*¬*¬*¬*1000<BR>2¬*¬*¬*¬*¬*¬*2000<BR>2 ¬*¬*¬*¬*¬*¬*3000<BR>2¬*¬*¬*¬*¬*¬*4000<BR>2¬*¬*¬*¬* ¬*¬*5000<BR><BR>I have a webform with 2 &#060;asp:listbox&#062; controls and I want to populate values from above table to my 2 listbox. (I.E all records from the table where LID = 1 to my first listbox and LID=2 to my 2nd ListBox. I am not sure how can I populate to 2 listbox in 1 SQL statement.<BR><BR>Should I get all the records from the database into a array list and do a string handling and then databind to 2 listbox? <BR>Any Ideas please.

  2. #2
    Join Date
    Dec 1969

    Default RE: <asp:listbox> control

    First, I personally think it would be easier to initiate collections of the seperate variables into different tables using seperate sql queries. But, if you must have only one sql query to the database I think you are looking for the options available in the DataView.FindRows method.<BR><BR>Check out:<BR>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconsortingfilteringdatausingdataview.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts