List<string> list=new List<string>(){"",""};
SqlParameter[] paras = new SqlParameter[list.Count];
for (int i = 0; i < list.Count; i++)
{
paras[i] = new SqlParameter("@" + i, list[i]);
}
string sql = "select * into tablename from Loan_RepaymentPlan where Loan_ApplyInfoID in(select loan_applyinfoid from Loan_ContractInfo where ContractNo in(@ContractNo));";
sql = sql.Replace("@ContractNo", string.Join(",", list.Select((v, i) => "@" + (i)).ToList()));
CurrDB.Database.ExecuteSqlCommand(sql, paras);
ef拼接多个参数执行
最新推荐文章于 2024-09-03 00:30:00 发布