-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetTest.aspx.vb
More file actions
45 lines (37 loc) · 1.73 KB
/
Copy pathNetTest.aspx.vb
File metadata and controls
45 lines (37 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Public Class NetTest
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader
Me.Conn = New System.Data.SqlClient.SqlConnection
'
'Conn
'
Me.Conn.ConnectionString = CType(configurationAppSettings.GetValue("PMSIConn.ConnectionString", GetType(System.String)), String)
End Sub
Protected WithEvents Conn As System.Data.SqlClient.SqlConnection
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Try
Conn.ConnectionString = "Server=CORTANA\SQLEXPRESS;Database=PMSI;Trusted_Connection=True;"
Conn.Open()
Catch ex As Exception
Trace.Warn("Page_Load", ex.Message)
Trace.Warn("Page_Load", Conn.ConnectionString)
Finally
If Conn.State <> ConnectionState.Open Then
Conn.Close()
End If
End Try
End Sub
End Class