Click here to Skip to main content
15,888,288 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hI
I have to upload excel data to mysql database throw windows forms application. i put comboboexs to access column names of excel sheet.
i bind all columns to the all comboboxes but i need to insert --select-- in starting of combobox list.
combobox1.DataSource = dt;
combobox1.ValueMember = ORDINAL_POSITION;
combobox1.DisplayMember =COLUMN_NAME;
combobox1.BindingContext = new BindingContext();


up tothis it is fine but i wonts to insert --select-- in starting of list.
i added it by
combobox.Items.Insert(0, new ListItem("Select", "0"));

but it showing error like this u cannot change data once u assign datasource.


how to solve the problem.
please tell me.
Posted

1 solution

 
Share this answer
 
v2

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

  Print Answers RSS


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