读书人

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

发布时间: 2012-01-31 21:28:41 作者: rapoo

大侠帮忙,已经开了几个贴了,急呀!!!!!!!!!!!
例如下
表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吗
那默认值在哪里绑定呢
===============================
你能把你究竟要干什么清清楚楚的说出来吗?

读书人网 >asp.net

热点推荐