你的意思不是很明白。使用dataadapter填充dataset构建多个表。然后用来绑定。

解决方案 »

  1.   

    wwl1981(小刀) 
    因为我是刚学的, 所以绑定还不太清楚,还不能做到上面第一点那样,麻烦有没有代码发一段给你看一看, 谢谢!
      

  2.   

    可以,你可以在下拉框名.Items.Add(对象名)
    这相对象名可以
    class item
    {
      int id
      string text
    }
    item tmp = new item()
    tmp.id = xx;
    tmp.text =xx;
    .items.add(tmp)
      

  3.   

    class item
    {
      int id;
      string text;
    public  override string ToString()
    {
    return text;
    }
    }
    加一个重载tostring()
      

  4.   

    这个问题是:
    1、DropDownList.Items.Add()方法有2次重载,应用参数是listitem的方法,就可以设定值和要显示的不同了。你先通过dataset构建一个listitem实例,然后在加上去。2、因为在你的dataset里面有多张表,所以用每个表构建树的每一层节点。
      

  5.   

    定义一个私有变量,要求有ID和NAME两个字段:DataTable depttable;建立列表(string 上级ID,string 前缀)
    {
    DataView table = DataObj.GetDataView("Select ID,前缀+NAME from Dept where belongid=上级ID Order By ID");
    foreach(DataRowView drv in table
    {
    depttable.ImportRow(drv.Row);
    建立列表(drv["ID"].ToString(),前缀+"|--");
    }
    }//能过上面方法,把列表信息加到depttable后,把这张表绑定到你的下拉列表框应该就可以了
      

  6.   

    DropDownList1.DataSource=depttable;
    DropDownList1.DataValueField="ID";
    DropDownList1.DataTextField="Name";上面的SQL语句要改一下:
    Select ID,前缀+NAME AS Name from Dept where belongid=上级ID Order By ID
      

  7.   

    我是项目是:C# ASP.net WEB 应用的项目啊!
      

  8.   

    override ToString()
    你就想怎么显示就怎么显示了