Global.asax.cs
上传用户:lxycoco
上传日期:2022-07-21
资源大小:38457k
文件大小:3k
源码类别:

C#编程

开发平台:

Others

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Web;
  5. using System.Web.SessionState;
  6. using System.Data;
  7. namespace PCSWebSrv2 
  8. {
  9. /// <summary>
  10. /// Summary description for Global.
  11. /// </summary>
  12. public class Global : System.Web.HttpApplication
  13. {
  14. /// <summary>
  15. /// Required designer variable.
  16. /// </summary>
  17. private System.ComponentModel.IContainer components = null;
  18. public Global()
  19. {
  20. InitializeComponent();
  21. }
  22. protected void Application_Start(Object sender, EventArgs e)
  23. {
  24.          System.Data.DataSet ds;
  25.          System.Data.OleDb.OleDbConnection oleDbConnection1;
  26.          System.Data.OleDb.OleDbDataAdapter daAttendees;
  27.          System.Data.OleDb.OleDbDataAdapter daRooms;
  28.          System.Data.OleDb.OleDbDataAdapter daEvents;
  29.          oleDbConnection1 = new System.Data.OleDb.OleDbConnection();
  30.          oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=C:\Inetpub" +
  31.             "\wwwroot\PCSWebApp3\PCSWebApp3.mdb";
  32.          oleDbConnection1.Open();
  33.          ds = new DataSet();
  34.          daAttendees = new System.Data.OleDb.OleDbDataAdapter(
  35.             "SELECT * FROM Attendees", oleDbConnection1);
  36.          daRooms = new System.Data.OleDb.OleDbDataAdapter(
  37.             "SELECT * FROM Rooms", oleDbConnection1);
  38.          daEvents = new System.Data.OleDb.OleDbDataAdapter(
  39.             "SELECT * FROM Events", oleDbConnection1);
  40.          daAttendees.Fill(ds, "Attendees");
  41.          daRooms.Fill(ds, "Rooms");
  42.          daEvents.Fill(ds, "Events");
  43.          oleDbConnection1.Close();
  44.          Application["ds"] = ds;
  45. }
  46.  
  47. protected void Session_Start(Object sender, EventArgs e)
  48. {
  49. }
  50. protected void Application_BeginRequest(Object sender, EventArgs e)
  51. {
  52. }
  53. protected void Application_EndRequest(Object sender, EventArgs e)
  54. {
  55. }
  56. protected void Application_AuthenticateRequest(Object sender, EventArgs e)
  57. {
  58. }
  59. protected void Application_Error(Object sender, EventArgs e)
  60. {
  61. }
  62. protected void Session_End(Object sender, EventArgs e)
  63. {
  64. }
  65. protected void Application_End(Object sender, EventArgs e)
  66. {
  67. }
  68. #region Web Form Designer generated code
  69. /// <summary>
  70. /// Required method for Designer support - do not modify
  71. /// the contents of this method with the code editor.
  72. /// </summary>
  73. private void InitializeComponent()
  74. {    
  75. this.components = new System.ComponentModel.Container();
  76. }
  77. #endregion
  78. }
  79. }