标签:
【in】
string sql = "exec(‘select * from bid where id in (‘+@IDS+‘)‘)";
System.Data.SqlClient.SqlParameter[] sp = new System.Data.SqlClient.SqlParameter[]
{
new System.Data.SqlClient.SqlParameter("@IDS","1,2,3,4,5,6,7,8")
};
System.Data.DataTable dt = SqlServerHelper.GetDataSet(sql, "PT", sp).Tables[0];
【like】
string sql2 = "select * from bid where id like ‘%‘+@ID+‘%‘";
System.Data.SqlClient.SqlParameter[] sp2 = new System.Data.SqlClient.SqlParameter[]
{
new System.Data.SqlClient.SqlParameter("@ID","8")
};
System.Data.DataTable dt2 = SqlServerHelper.GetDataSet(sql2, "PT", sp2).Tables[0];
标签:
原文地址:http://www.cnblogs.com/yf2011/p/4549514.html