1.我的数据源是DataSet.xsd的数据集,然后查找数据集中的AClass数据表,想把得到的信息绑定到RadioButtonList中            
DataSet dataSet = new DataSet();
string sql = "SELECT head, headName FROM " + dataSet.AClass + " WHERE headName LIKE '%" + txt.Text.Trim() +"%'";   //模糊查询名称
RadioButtonList rdlHS = new RadioButtonList();
请问如何查找查询结果,如何把结果绑定到RadioButtonList中

解决方案 »

  1.   

    for(int i=0;i<dataSet.Tables[0].Rows.Count;i++)
    {
       RadioButtonList1.Items.Add(new ListItem(text,value));//text和value是参数
        //按你的查询应该是RadioButtonList1.Items.Add(new ListItem(dataSet.Tables[0].Rows[i]["headname"].ToString(),dataSet.Tables[0].Rows[i]["head"].ToString()));
    }
      

  2.   

    DataSet set = new DataSet();
      set.ReadXmlSchema(descDirectory + @"\" + fileName + ".xsd");
      set.ReadXml(descDirectory + @"\" + fileName + ".xml");
    再绑定 table
      

  3.   


    难道RadioButtonList不能直接绑定数据源吗?
    如果我想把查询出来的结果保存到一个Table中,并命名这个怎么弄呢?请指教!