-
Notifications
You must be signed in to change notification settings - Fork 0
/
EndPointHelper.cs
28 lines (26 loc) · 1.05 KB
/
EndPointHelper.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using DevExpress.Xpo.DB;
namespace E5137 {
public class EndPointHelper {
public static IDataStore GetDataStore(string connectionString) {
EndpointAddress address = new EndpointAddress(connectionString);
BasicHttpBinding binding = 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 {
IDataStore store = new DataStoreClient(binding, address);
store.AutoCreateOption.ToString();
return store;
}
catch(Exception e) {
throw new DevExpress.Xpo.DB.Exceptions.UnableToOpenDatabaseException(connectionString, e);
}
}
}
}