SQL 注入 参数化

明月清风精进不止 2019-12-31

StringBuilder sbSelect = new StringBuilder();

System.Data.OracleClient.OracleParameter[] parms = { };
ArrayList listParms = new ArrayList();
string sqlgetobject = "select t.* from table t where t.id= :ID ";
listParms.Add(new System.Data.OracleClient.OracleParameter(":ID ", this.ID));
parms = (System.Data.OracleClient.OracleParameter[])listParms.ToArray(typeof(System.Data.OracleClient.OracleParameter));

DataTable dteval = bll.GetbySql(sqlgetobject, parms);

相关推荐

jiong / 0评论 2020-09-17