首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-01-31 
大侠帮忙,已经开了几个贴了,急呀!!!!!!!!!!!例如下表1表2idnametimeid2name2id11a1q1a212b1w2b233c1e3c22

大侠帮忙,已经开了几个贴了,急呀!!!!!!!!!!!
例如下
表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吗


那默认值在哪里绑定呢

请指教



[解决办法]
你是说id2里存在的才显示,不存在的不显示吗?
[解决办法]
可是表2的id1应该如何取得
再读一次表2吗
那默认值在哪里绑定呢
===============================
你能把你究竟要干什么清清楚楚的说出来吗?

热点排行