问高手个控件绑定数据的问题
string coun = "select count(*) as topn from answer where QuestionID1=" + Label1.Text + " and ProjectID1='20090302'";
comm = new OleDbCommand(coun, conn);
OleDbDataReader read6 = comm.ExecuteReader();
if (read6.Read())
{
int topn = Convert.ToInt32(read6["topn"].ToString());
string sql6;
if (randoma == "True")
{
sql6 = "select top " + topn + " * from answer where QuestionID1=" + Label1.Text + " and ProjectID1='20090302' order by rnd(Id)";
}
else
{
sql6 = "select top " + topn + " * from answer where QuestionID1=" + Label1.Text + " and ProjectID1='20090302'";
}
comm = new OleDbCommand(sql6, conn);
OleDbDataReader read7 = comm.ExecuteReader();
if (read7.Read())
{
if (type == "单选")
{
input = read7["Inputable1"].ToString();
if (input == "False")
{
RadioButtonList1.DataSource = read7;
RadioButtonList1.DataTextField = "Answer1";
RadioButtonList1.DataBind();
RadioButtonList1.Visible = true;
}
else
{
RadioButtonList1.DataSource = read7;
RadioButtonList1.DataTextField = "Answer1";
RadioButtonList1.DataBind();
RadioButtonList1.Visible = true;
TextBox2.Visible = true;
TextBox2.Enabled = true;
}
}
正确的应该是4条记录,为什么绑定出来后是3条记录?请各位帮我看看,谢谢