日期:2014-05-19  浏览次数:20389 次

大侠帮忙,已经开了几个贴了,急呀!!!!!!!!!!!
例如下
表1                                                       表2
id                 name       time                     id2                 name2             id1
1                     a1             q                       1                       a2                 1
2                     b1             w                       2                       b2                 3
3                     c1             e                       3                       c2                 2  

下拉列表绑定了表1   中的name和time  

这是我绑定下拉列表的代码
  private   void   DllFreDateBind()
        {
                string   strConn   =   System.Configuration.ConfigurationSettings.AppSettings[ "2ValorCnsDB "].ToString();
                SqlConnection   conPubs   =   new   SqlConnection(strConn);

                conPubs.Open();

                string   ID   =   Request.QueryString[ "id "];

                string   sql   =   "Select   FreID,(convert(char(10),outDate)+   FreightWay)   as   Freight   From   FreightLog   where   isvalid=1 ";

                SqlDataAdapter   da   =   new   SqlDataAdapter(sql,   conPubs);

                DataSet   table   =   new   DataSet();

                da.Fill(table);
                conPubs.Close();

                //对dll做数据绑定
                DllFreight.DataSource   =   table;
                DllFreight.DataTextField   =   "Freight ";
                DllFreight.DataValueField   =   "FreID ";
                //DllFreight.Items.FindByValue( "FreID ").Selected   =   true;
                DllFreight.DataBi