问个问题
1、SqlHelper.ExecuteReader(conn,CommandType.Text,"select * from tab where Id="+ID);
2、SqlHelper.ExecuteReader(conn,CommandType.Text,"select * from tab where Id=@ID",new SqlParameter("@ID",ID));
两个比较 那个速度快些?
[解决办法]
第一个 但第一个容易被sql注入
[解决办法]
[解决办法]
发布时间: 2012-03-16 16:34:56 作者: rapoo
问个问题
1、SqlHelper.ExecuteReader(conn,CommandType.Text,"select * from tab where Id="+ID);
2、SqlHelper.ExecuteReader(conn,CommandType.Text,"select * from tab where Id=@ID",new SqlParameter("@ID",ID));
两个比较 那个速度快些?
[解决办法]
第一个 但第一个容易被sql注入
[解决办法]