0

当我想将组合框与表格列绑定时,我在链接中有错误,如图像,这是图像链接http://s23.postimg.org/btzj2n66j/Capture.png ------ 这是我的代码

private void bindcombo ()
    {
        OleDbCommand com = new OleDbCommand();
        OleDbDataReader reader;
        com.Connection = db_con;
        db_con.Open();
        com.CommandText = "select * from colleges";
        reader = com.ExecuteReader();
        while(reader.Read())
        {
            string combo_items = reader.GetString("college_name");
            college_name.Items.Add(combo_items);//college_name is a combobox
        }
4

1 回答 1

0

GetString() 方法只接受 int 作为参数,您正在尝试使用字符串。哈特对此持怀疑态度?

于 2013-07-31T11:06:30.410 回答