private void showBoxList()
{
sql="select * from keywords order by id desc";
objComm = new OleDbCommand(sql,objConn);
objConn.Open();
OleDbDataReader dr=objComm.ExecuteReader(CommandBehavior.CloseConnection);
if(dr.Read())
{
this.CheckBoxList1.DataSource=dr;
this.CheckBoxList1.DataBind();
}
}
这样在调试时出现的全是:System.Data.Common.DbDataRecord
第二个问题:
如何显示我选中的所有复选框的text属性值?
{
sql="select * from keywords order by id desc";
objComm = new OleDbCommand(sql,objConn);
objConn.Open();
OleDbDataReader dr=objComm.ExecuteReader(CommandBehavior.CloseConnection);
if(dr.Read())
{
this.CheckBoxList1.DataSource=dr;
this.CheckBoxList1.DataBind();
}
}
这样在调试时出现的全是:System.Data.Common.DbDataRecord
第二个问题:
如何显示我选中的所有复选框的text属性值?
CheckBoxList1.DataValueFile="column name that you want to manipulate"
CheckBoxList1.DataValueFile="column name that you want to manipulate"
c.ConnObj.Open()
Dim a As New ArrayList Dim dr As OleDbDataReader = mycom.ExecuteReader
While dr.Read a.Add(dr("book_id"))
End While
Me.CheckBoxList1.DataSource = a
Me.CheckBoxList1.DataBind()
c.ConnObj.Close()奶奶的,这个问题搞了几个小时,不知道什么地方搞错误了,郁闷。
楼主测试吧,应该没问题了。我测试成功