成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

datalist控件顯示數(shù)據(jù) DropDownList怎樣與數(shù)據(jù)庫中的數(shù)據(jù)綁定?

DropDownList怎樣與數(shù)據(jù)庫中的數(shù)據(jù)綁定?第一步:連接數(shù)據(jù)庫第二步:取得數(shù)據(jù)/第三步:為其指定數(shù)據(jù)源第四步:指定其text和value值。第五步:綁定參考代碼:SqlConnection co

DropDownList怎樣與數(shù)據(jù)庫中的數(shù)據(jù)綁定?

第一步:連接數(shù)據(jù)庫第二步:取得數(shù)據(jù)/第三步:為其指定數(shù)據(jù)源第四步:指定其text和value值。第五步:綁定參考代碼:SqlConnection con3=new SqlConnection("Server=.user id=sapassword=123456Database=FABS") con3.Open() SqlCommand cmd3=new SqlCommand() cmd3.CommandText="select * from sheng" cmd3.CommandType=CommandType.Text cmd3.Connection=con3 SqlDataReader sdr3=cmd3.ExecuteReader() DropDownList1.DataSource =sdr3 DropDownList1.DataTextField = "shengming" DropDownList1.DataBind() con3.Close()