forked from DevExpress-Examples/out-of-maintenance-XPO_tutorial-1-your-first-data-aware-application-with-xpo-e4555
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConnectionHelper.vb
30 lines (29 loc) · 1.6 KB
/
ConnectionHelper.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
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Imports System
Imports DevExpress.Xpo
Imports DevExpress.Data.Filtering
Namespace XpoTutorial1.DataModel
Public Module ConnectionHelper
Public Const ConnectionString As String = "XpoProvider=MSSqlServer;data source=(local);integrated security=SSPI;initial catalog=XpoTutorial1"
Public Sub Connect(ByVal autoCreateOption As DevExpress.Xpo.DB.AutoCreateOption)
XpoDefault.DataLayer = XpoDefault.GetDataLayer(ConnectionString, autoCreateOption)
XpoDefault.Session = Nothing
End Sub
Public Function GetConnectionProvider(ByVal autoCreateOption As DevExpress.Xpo.DB.AutoCreateOption) As DevExpress.Xpo.DB.IDataStore
Return XpoDefault.GetConnectionProvider(ConnectionString, autoCreateOption)
End Function
Public Function GetConnectionProvider(ByVal autoCreateOption As DevExpress.Xpo.DB.AutoCreateOption, <System.Runtime.InteropServices.Out()> ByRef objectsToDisposeOnDisconnect() As IDisposable) As DevExpress.Xpo.DB.IDataStore
Return XpoDefault.GetConnectionProvider(ConnectionString, autoCreateOption, objectsToDisposeOnDisconnect)
End Function
Public Function GetDataLayer(ByVal autoCreateOption As DevExpress.Xpo.DB.AutoCreateOption) As IDataLayer
Return XpoDefault.GetDataLayer(ConnectionString, autoCreateOption)
End Function
End Module
End Namespace