标签:contex temp add sql ppa condition code list string
List<string> ConditionList = new List<string>();
List<string> tempParameters = new List<string>();//用来存(@a0,@a1,@a2)
string value = HttpContext.Current.Request[parameter.ParameterCode];//请求过来的数据
string[] valueArr = value.Split(",");
for (int i = 0; i < valueArr.Length; i++)
{
tempParameters.Add($"@{parameter.ParameterCode}{i}");//@a0
sqlParameters.Add(new SqlParameter()
{
ParameterName = $"@{parameter.ParameterCode}{i}",
Value = valueArr[i]
});
}
ConditionList.Add($"{parameter.TableCode}.{parameter.FieldsCode} in({string.Join(",", tempParameters)})");
标签:contex temp add sql ppa condition code list string
原文地址:http://www.cnblogs.com/gaocong/p/7942025.html