我通常使用有问题的小参数,但在这种情况下,我需要动态地创造不仅仅是参数。
Could someone use injection on any of the variables? Aside from a stored procedure is there a simple way to protect against injection via code?
string whereClause = "WHERE " + filter.ToString() + " > " + nextStartPoint;
string orderBy = "ORDER BY " + filter.ToString() + " DESC";
http://www.ohchr.org。
string sql = "SELECT TOP(" + numItemsToGet + ") * " +
"FROM Items " +
whereClause + " " +
orderBy;
Update
过滤器。 缩略语
我对以下工作感到惊讶(部分工作)。 我还认为,你必须参考一栏名称,并注明精度参数。
cmd.Parameters.AddWithValue("Count", 10);
string sql = "SELECT TOP(@Count) * " +