Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my scenario is:
Submit page: I have a list box 'lbTechnology' containing technologies.
User can multiselect them and I am saving the items by seperating by comma. (msoffice, msvisualstudio, sharepoint...) in one row.

View page: In the next page I want to populate data based on technology.
So I want to fill dropdown list with the technologies (msoffice, msvisualstudio, sharepoint...)

I am fetching the data from db to dataset.
How can I fill the technologies in the drop down like:
All
msoffice
msvisualstudio
sharepoint


Can anybody help regarding the above ASAP

Thanks in advance.
Posted
Updated 8-Nov-10 22:44pm
v3
Comments
Dalek Dave 9-Nov-10 4:44am    
Edited for Readability.

See your data will be in CSV format then you can easily use splitted string array as a datasource to dropdownlist

i.e

Dropdownlist1.DataSource = YourCSVString.Split(',');
Dropdownlist1.DataBind();


Please vote and Accept Answer if it Helped.
 
Share this answer
 
Comments
Dalek Dave 9-Nov-10 4:44am    
Good Call.
thatraja 9-Nov-10 4:50am    
Good answer
string str = "msoffice,msvisualstudio,sharepoint";
        DropDownList1.Items.Add("All");
        foreach(string s in str.Split(','))
        {
            DropDownList1.Items.Add(s);
            //Response.Write(s + "<br>");
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900