当前位置: 代码迷 >> ASP.NET >> 大侠帮忙,已经开了几个贴了,呀!解决方案
  详细解决方案

大侠帮忙,已经开了几个贴了,呀!解决方案

热度:10083   发布时间:2013-02-25 00:00:00.0
大侠帮忙,已经开了几个贴了,急呀!!!!!!!!!!!
例如下
表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.DataBind();

        }

可是表2的id1应该如何取得
再读一次表2吗
  相关解决方案