62,254
社区成员
发帖
与我相关
我的任务
分享
string TypeID = "select ShowType from CustomerInfo where ID="+newsid;
SqlDataAdapter Type = new SqlDataAdapter("select ID ,Types from ShowType", conn);
DataSet dsType = new DataSet();
Type.Fill(dsType, "ShowType");
this.ShowType.DataSource = dsType.Tables["ShowType"].DefaultView;
this.ShowType.DataTextField = "Types";
this.ShowType.DataValueField = "ID";
this.ShowType.SelectedValue = "TypeID";
this.ShowType.DataBind();
newsid = Request.Params["id"];
SqlDataAdapter Type = new SqlDataAdapter("select ID ,Types from ShowType", conn);
DataSet dsType = new DataSet();
Type.Fill(dsType, "ShowType");
this.ShowType.DataSource = dsType.Tables["ShowType"].DefaultView;
this.ShowType.DataTextField = "Types";
this.ShowType.DataValueField = "id";
this.ShowType.DataBind();
string sql=select name,type from 资料,类型 where types=类型.id
执行 sql
返回
dataset
if(name='张三')
string sql=select name,type from 资料,类型 where types=类型.id and name='张三'
执行 sql
返回
dataset
ddl_Project.DataSource = dataset
ddl_Project.DataValueField = "type ";
ddl_Project.DataTextField = "type ";
ddl_Project.DataBind();