Click here to Skip to main content
15,919,358 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi. i have a array items in a combobox A(22,23,24,01). How to obligate user choose as sequence from the first value to end value, choose value 22 then check 22 is avaiable or not, if 22 was choose, continue aggree for user choose the next value 23...

What I have tried:

please help me code.
thanks very much!
Updated 1-Dec-17 5:57am
Dotnet_Dotnet 1-Dec-17 10:22am    
Please clarify the array items in value field or text field of combobox
Arham Anees 1-Dec-17 12:27pm    
please clarify your question. do you mean SelectedValue? or something else

click on combobox then in properties dialogBox set 'DropDown Style' to 'DropDownList'
for array, you need
string select= "SELECT column FROM table WHERE condition";
SqlConnection con = new SqlConnection(/*conmectionstring*/);
SqlCommand cmd = new SqlCommand(selectcmd, con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
combobox.DisplayMember = "column";
combobox.ValueMember = "column";
combobox.DataSource = dt;
Share this answer
hi those are value field from dataset binding
Share this answer
Richard MacCutchan 1-Dec-17 10:54am    
Please do not post additional information as a Solution. People will ignore your question, thinking it has been answered.

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