This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
WebApplication.vb
78 lines (69 loc) · 3.82 KB
/
WebApplication.vb
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports DevExpress.ExpressApp
Imports DevExpress.ExpressApp.Web
Imports DevExpress.ExpressApp.Xpo
Namespace LongRunningOperations.Web
Partial Public Class LongRunningOperationsAspNetApplication
Inherits WebApplication
Private module1 As DevExpress.ExpressApp.SystemModule.SystemModule
Private module2 As DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule
Private module3 As LongRunningOperations.Module.LongRunningOperationsModule
Private sqlConnection1 As System.Data.SqlClient.SqlConnection
Public Sub New()
InitializeComponent()
End Sub
Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
args.ObjectSpaceProvider = New XPObjectSpaceProviderThreadSafe(args.ConnectionString, args.Connection)
End Sub
Private Sub LongRunningOperationsAspNetApplication_DatabaseVersionMismatch(ByVal sender As Object, ByVal e As DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs) Handles Me.DatabaseVersionMismatch
#If EASYTEST Then
e.Updater.Update()
e.Handled = True
#Else
If System.Diagnostics.Debugger.IsAttached Then
e.Updater.Update()
e.Handled = True
Else
Dim message As String = "The application cannot connect to the specified database, because the latter doesn't exist or its version is older than that of the application." & vbCrLf &
"This error occurred because the automatic database update was disabled when the application was started without debugging." & vbCrLf &
"To avoid this error, you should either start the application under Visual Studio in debug mode, or modify the " &
"source code of the 'DatabaseVersionMismatch' event handler to enable automatic database update, " &
"or manually create a database using the 'DBUpdater' tool." & vbCrLf &
"Anyway, refer to the following help topics for more detailed information:" & vbCrLf &
"'Update Application and Database Versions' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument2795.htm" & vbCrLf &
"'Database Security References' at http://www.devexpress.com/Help/?document=ExpressApp/CustomDocument3237.htm" & vbCrLf &
"If this doesn't help, please contact our Support Team at http://www.devexpress.com/Support/Center/"
If e.CompatibilityError IsNot Nothing AndAlso e.CompatibilityError.Exception IsNot Nothing Then
message &= vbCrLf & vbCrLf & "Inner exception: " & e.CompatibilityError.Exception.Message
End If
Throw New InvalidOperationException(message)
End If
#End If
End Sub
Private Sub InitializeComponent()
Me.module1 = New DevExpress.ExpressApp.SystemModule.SystemModule()
Me.module2 = New DevExpress.ExpressApp.Web.SystemModule.SystemAspNetModule()
Me.module3 = New LongRunningOperations.Module.LongRunningOperationsModule()
Me.sqlConnection1 = New System.Data.SqlClient.SqlConnection()
DirectCast(Me, System.ComponentModel.ISupportInitialize).BeginInit()
'
' sqlConnection1
'
Me.sqlConnection1.ConnectionString = "Integrated Security=SSPI;Pooling=false;Data Source=.\SQLEXPRESS;Initial Catalog=LongRunningOperations"
Me.sqlConnection1.FireInfoMessageEventOnUserErrors = False
'
' LongRunningOperationsAspNetApplication
'
Me.ApplicationName = "LongRunningOperations"
Me.Connection = Me.sqlConnection1
Me.Modules.Add(Me.module1)
Me.Modules.Add(Me.module2)
Me.Modules.Add(Me.module3)
'INSTANT VB NOTE: The following InitializeComponent event wireup was converted to a 'Handles' clause:
'ORIGINAL LINE: this.DatabaseVersionMismatch += new System.EventHandler<DevExpress.ExpressApp.DatabaseVersionMismatchEventArgs>(this.LongRunningOperationsAspNetApplication_DatabaseVersionMismatch);
DirectCast(Me, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
End Class
End Namespace