使用下面的語句來創建SQLDataReader的對象來試試.
SqlDataReader sdr= command.ExecuteReader();

解决方案 »

  1.   

            SqlConnection Myconn = new SqlConnection(Myconnection);
            Myconn.Open();
            SqlCommand Mycomm = new SqlCommand(MySql, Myconn);
            CheckBoxList1.DataSource = Mycomm.ExecuteReader();
            CheckBoxList1.DataTextField = "字段";
            CheckBoxList1.DataValueField = "字段";
            CheckBoxList1.DataBind();
            Myconn.Close();