标签:
public bool UpdateCaseInfo(Dictionary<string, object> Str, long caseId) { using (DbManager db = DbFactory.DB) { string updateStr = ""; List<IDbDataParameter> paraS = new List<IDbDataParameter>(); foreach (var item in Str) { updateStr += item.Key + "=@" + item.Key+ ","; paraS.Add(db.Parameter("@" + item.Key, item.Value)); } updateStr = updateStr.Remove(updateStr.Length - 1); updateStr = "update dbo.T_table set " + updateStr + " where CaseID=‘" + caseId.ToString() + "‘"; return db.SetCommand(updateStr, paraS.ToArray() ).ExecuteScalar<bool>(); } }
标签:
原文地址:http://www.cnblogs.com/oyer/p/5822767.html