?? conferencedb.vb
字號:
Imports System
Imports System.Web
Imports System.Collections
Namespace Conference
'*******************************************************
'
' Conference Class
'
' A helper Class that encapsulates (and then caches) a
' call out to the ASP+ Config System to obtain a database DSN.
' Administrators can change the application's database
' location simply by altering the config.web file in the
' root directory of the application.
'
'*******************************************************
Public Class ConferenceDB
Shared m_ConnectionString As String
'*******************************************************
'
' ConferenceDB.ConnectionString Property
'
' The ConferenceDB.ConnectionString property encapsulates
' a callout to the ASP+ Config System to obtain the
' database connection string for the application.
'
'*******************************************************
Shared ReadOnly Property ConnectionString As String
Get
' Pull the ConnectionString from the ASP+ AppSettings section.
' Cache in static field for faster repeat access.
If m_ConnectionString = "" Then
Dim appsetting As Hashtable = CType(HttpContext.Current.GetConfig("appsettings"), Hashtable)
m_ConnectionString = CStr(appsetting("DSN"))
If m_ConnectionString = "" Then
throw new Exception("Conference DSN Value not set in Config.web")
End if
End If
' Return the Connection String
return m_connectionString
End Get
End Property
End Class
End Namespace
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -