Click here to Skip to main content
15,357,293 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to populated combo box using Excel column in c# please help...thanks in adv..

What I have tried:

<pre> Workbook workbook = new Workbook();  
            //Load Excel file  
            //Get the first worksheet  
            Worksheet sheet = workbook.Worksheets[0];  
            //Bind data in the first Excel column to combo box  
            for (int row = 1; row < sheet.Rows.Count()+1; row++)  
               string value = sheet.Range[row, 1].Value;  
Updated 19-Jul-21 22:38pm
Patrice T 13-Apr-20 4:58am
what is the problem with this code ?
Sam_gaik 13-Apr-20 5:23am
It does not work..!
Patrice T 13-Apr-20 5:28am
This is not informative.
what it does that is not expected, what it don't that is expected?

Just read whole string and create a List<objectthatuwant> with data and fill the list, afther that just give ur combobox a datasource as like:

List<objectthatuwant> list;//fill this list with your data
BindingSource source = new BindingSource();

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