<asp:listbox> control

rxianorarickwew

New Member
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??????Singapore<BR>2??????1000<BR>2??????2000<BR>2??????3000<BR>2??????4000<BR>2??????5000<BR><BR>I have a webform with 2 <asp:listbox> 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.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
 
Back
Top