本文介绍了如何设置仅在组合框中选择值作为数组顺序从数组项值C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
喜。我在组合框A(22,23,24,01)中有一个数组项。如何强制用户选择从第一个值到结束值的序列,选择值22然后检查22是否可用,如果选择22,则继续aggree为用户选择下一个值23 ...
我尝试过:
请帮我编码。
非常感谢!
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!
推荐答案
string select= "SELECT column FROM table WHERE condition";
SqlConnection con = new SqlConnection(/*conmectionstring*/);
con.Open();
SqlCommand cmd = new SqlCommand(selectcmd, con);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
con.Close();
combobox.DisplayMember = "column";
combobox.ValueMember = "column";
combobox.DataSource = dt;
这篇关于如何设置仅在组合框中选择值作为数组顺序从数组项值C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!