页面传值验证(防SQL注入)
Global.asax文件中
在页面跳转时,防止传值的参数中SQL注入:
void Application_BeginRequest(object sender, EventArgs e)
{
ProcessRequest();
}
void ProcessRequest()
{
try
{
if (HttpContext.Current.Request.Form.Count > 0)
{
NameValueCollection collection = HttpContext.Current.Request.Form;
foreach (string strKeys in collection.AllKeys)
{
if (strKeys == "__VIEWSTATE")
{
continue;
}
else
{
if (!CheckRequest(collection.Get(strKeys)))
{
System.Web.HttpContext.Current.Response.End();
}
}
}
}
&nbs
相关文档:
摘要
对于SQL Server中的约束,想必大家并不是很陌生。但是约束中真正的内涵是什么,并不是很多人都很清楚的。本文以详细的文字来介绍了什么是约束,以及如何在数据库编程中应用和使用这些约束,来达到更好的编程效果。(本文部分内容参考了SQL Server联机手册)
内容
数据完整性分类
实体完整性
&nb ......
函数
SQLServer和Oracle的常用函数对比
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001 ......
1、按年查询:select * from dbo.td_BBSBoardInfo where (year(BBI_DateTime) between 2006 and 2009)
按月、日查询只要将year 改为 month、data
2、按年月查询:select * from dbo.td_BBSBoardInfo where convert(varchar(6),BBI_DateTime,112) between 200606 and 200911 ......
1.查询出当前连接然后将其关闭
select spid
from master.dbo.sysprocesses
where dbid= db_id('数据库名')
--db_id('DoNet')
如spid 值为 52.
2. 執行:
kill 52
3.修改數據庫名
EXEC sp_dboption 'old_db_name', 'Single User', 'false'
&nb ......