第1个回答 2012-10-01
你要使用模糊查询就要用like % ,下面上我用的下拉列表框来梆定的数据,你参考下:
/// <summary>
/// 绑定城市名
/// </summary>
private void GetDrop_city()
{
string seleCity = "select cityID,city from city where MID(city.cityID,1,2)=MID(" + Drop_sheng.SelectedValue + ",1,2)";
Drop_shi.DataSource = this.SqlData(seleCity);
Drop_shi.DataTextField = "city";
Drop_shi.DataValueField = "cityID";
Drop_shi.DataBind();
}
你会使用like %的查询吧?谢谢