1.禁用会话状态
<%@ Page EnableSessionState="false"%>
2.使用Page.IsPostBack
3.避免使用服务器控件
4.禁用服务器控件的状态视图
5.避免使用DataGrid
6.避免装箱操作
7.使用StringBuilder类(Append,Remove,Insert方法)
8.适当的时候打开,关闭连接(尽量推迟打开数据库连接,数据操作完成后要及时关闭数据库连接
9.数据库查询使用带有参数的SQL命令或存储过程
eg:SqlCommand cmd=new SqlCommand(SqlName,MyConnection);
String SelectCMD="select * from employees where employeeID=@ID";
SqlParameter ParaID=new SqlParameter("@ID",SqlDbType.Int,4);
ParaID.Value=3;
cmd.Parameters.Add(ParaID);
cmd.CommandText=SelectCMD;
10.使用WAS与ACT测试工具对Web应用程序进行测试监控

相关文章:

  • 2021-07-10
  • 2021-08-19
  • 2021-08-18
  • 2021-12-03
  • 2022-12-23
  • 2021-06-23
  • 2022-02-09
  • 2021-10-24
猜你喜欢
  • 2021-10-21
  • 2021-12-04
  • 2021-09-28
  • 2021-08-25
  • 2021-06-30
  • 2021-07-28
相关资源
相似解决方案