我用Winform做的一个员工管理系统
部分代码如下:也就是出错的代码
private void SetDeptNo()
{
string s = "select deptno from emp";
cmd = new SqlCommand(s, con);
con.Open();
dr = cmd.ExecuteReader();
while (dr.Read())
{
comboBox3.Items.Add(dr.GetInt32(0));
}
comboBox1.SelectedIndex = 0;
dr.Close();
con.Close();
cmd.Dispose();
}
提示错误信息“无法将类型为“System.Int32”的对象强制转换为类型“System.String”。”
comboBox1中要输入一个整数该怎么办啊???