ASP.NET 中DAL层的SQL语句问题.
以下俩种SQL语句哪个比较好点?1.sql=string.Format("select*fromStockwhereProductNamelike'%{0}%'andIn...
以下俩种SQL语句哪个比较好点?
1.sql = string.Format("select * from Stock where ProductName like '%{0}%' and InDate>='{1}'", name, time);
sql = "select * from Stock where ProductName like '%" + name + "%' and InDate>=@InDate"; 展开
1.sql = string.Format("select * from Stock where ProductName like '%{0}%' and InDate>='{1}'", name, time);
sql = "select * from Stock where ProductName like '%" + name + "%' and InDate>=@InDate"; 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询