Ajax实现在textbox中输入内容,动态从数据库中模糊查询显示到下拉框中
2010-4-9 2:30:02 出处:https://www.yqdown.com
} #endregion
GetCityList#region GetCityList [Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.Read)] public DataSet GetCityList(int provinceid) { string sql = "select * from city where father like '%" + provinceid + "%'"; return GetDataSet(sql); } #endregion GetDataSet#region GetDataSet public static DataSet GetDataSet(string sql) { string ConnectionString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]; SqlDataAdapter sda = new SqlDataAdapter(sql, ConnectionString); DataSet ds = new DataSet(); sda.Fill(ds); return ds; } #endregion
分享到