c# combox控件的 dropdown问题
privatevoidcomboBox_select_saler_DropDown(objectsender,EventArgse){D_atabaseOperatort...
private void comboBox_select_saler_DropDown(object sender, EventArgs e)
{
D_atabaseOperator temp_Operator = new D_atabaseOperator();
DataTable temp_DataTable = new DataTable();
temp_DataTable = temp_Operator.ReturnTable("select em_no,em_name from Employ","Employ");
comboBox_select_saler.DataSource = temp_DataTable;
comboBox_select_saler.DisplayMember = "em_name";
comboBox_select_saler.ValueMember = "em_no";
public DataTable ReturnTable(string SQLcmd, string tablename)
{
RS_Connection.Open();
RS_adapter = new SqlDataAdapter(SQLcmd, RS_Connection);
RS_CommandBuilder = new SqlCommandBuilder(RS_adapter);
try
{
RS_adapter.Fill(RS_DataTable);
}
catch
{
RS_Table.success = false;
RS_Connection.Close();
return RS_DataTable;
}
RS_Connection.Close();
return RS_DataTable;
}
点击后combox显示了要现实的列表,选择之后combox的text却什么也不显示,然后点击其他控件combox的text就显示了。什么错误???求解 展开
{
D_atabaseOperator temp_Operator = new D_atabaseOperator();
DataTable temp_DataTable = new DataTable();
temp_DataTable = temp_Operator.ReturnTable("select em_no,em_name from Employ","Employ");
comboBox_select_saler.DataSource = temp_DataTable;
comboBox_select_saler.DisplayMember = "em_name";
comboBox_select_saler.ValueMember = "em_no";
public DataTable ReturnTable(string SQLcmd, string tablename)
{
RS_Connection.Open();
RS_adapter = new SqlDataAdapter(SQLcmd, RS_Connection);
RS_CommandBuilder = new SqlCommandBuilder(RS_adapter);
try
{
RS_adapter.Fill(RS_DataTable);
}
catch
{
RS_Table.success = false;
RS_Connection.Close();
return RS_DataTable;
}
RS_Connection.Close();
return RS_DataTable;
}
点击后combox显示了要现实的列表,选择之后combox的text却什么也不显示,然后点击其他控件combox的text就显示了。什么错误???求解 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询