private void DdlProvince_SelectedIndexChanged(object sender, System.EventArgs e)
{
string proid=this.DdlProvince.SelectedValue;
SqlConnection con=DB.createConnection();
con.Open();
SqlCommand cmd=new SqlCommand("select * from city where proId="+proid,con);
SqlDataReader sdr=cmd.ExecuteReader();
this.DdlCity.DataSource=sdr;
this.DdlCity.DataTextField="cityName";
this.DdlCity.DataValueField="cityId";
this.DdlCity.DataBind();
sdr.Close();
con.Close();
}
我本意是:选中省,会自动罗列出其市名,
但结果好象不行!
为什么这样运行结果不对?