-
Notifications
You must be signed in to change notification settings - Fork 0
/
EndPointHelper.vb
27 lines (25 loc) · 1.06 KB
/
EndPointHelper.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
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.ServiceModel
Imports DevExpress.Xpo.DB
Namespace E5137
Public Class EndPointHelper
Public Shared Function GetDataStore(ByVal connectionString As String) As IDataStore
Dim address As New EndpointAddress(connectionString)
Dim binding As New BasicHttpBinding()
binding.MaxReceivedMessageSize = Int32.MaxValue
binding.ReaderQuotas.MaxArrayLength = Int32.MaxValue
binding.ReaderQuotas.MaxDepth = Int32.MaxValue
binding.ReaderQuotas.MaxBytesPerRead = Int32.MaxValue
binding.ReaderQuotas.MaxStringContentLength = Int32.MaxValue
Try
Dim store As IDataStore = New DataStoreClient(binding, address)
store.AutoCreateOption.ToString()
Return store
Catch e As Exception
Throw New DevExpress.Xpo.DB.Exceptions.UnableToOpenDatabaseException(connectionString, e)
End Try
End Function
End Class
End Namespace