发布网友 发布时间:2022-04-07 08:01
共1个回答
热心网友 时间:2022-04-07 09:31
if (DropDownList3.SelectedValue == 请选择){if (DropDownList2.SelectedValue == 请选择){ViewState[cmd] = string.Format(C_Area = '{0}', DropDownList1.SelectedValue);}else{ViewState[cmd] = string.Format(C_Area='{0}' and C_JobType like '%{1}%', DropDownList1.SelectedValue, DropDownList2.SelectedValue);}}else{ViewState[cmd] = string.Format(C_Area='{0}' and C_JobType like '%{1}%' and C_Name='{2}', DropDownList1.SelectedValue, DropDownList2.SelectedValue, DropDownList3.SelectedValue);}这个是以前写的代码,通过字符串构造一部分SQL语句,传递到数据库操作代码中去