Configuration
Overview
Contains information about all known ADO.NET providers and database providers with which Data Abstract for .NET can work.
Note: The Configuration static class is loaded at the start up of a server through the use of one of the multiple Load* overloads (by default the Load parameter), and is then used by most of the other classes contained in the RemObjects.DataAbstract.Server assembly. The Data Abstract server templates include the code needed to load the configuration.
Location
- Reference: RemObjects.DataAbstract.Server.dll
- Namespace: RemObjects.DataAbstract.Server
DatabaseProfiles
Provides access to all the database profiles known to the server application.
class property DatabaseProfiles: RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DatabaseProfile> read;
class RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DatabaseProfile> DatabaseProfiles { get; }
Shared ReadOnly Property DatabaseProfiles() As RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DatabaseProfile>
DataProviders
Provides access to all the ADO.NET providers known to the server application.
class property DataProviders: RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DataProviderInfo> read;
class RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DataProviderInfo> DataProviders { get; }
Shared ReadOnly Property DataProviders() As RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DataProviderInfo>
Load
Loads a Data Abstract configuration using the default mechanism, which looks in several places for a valid .daConfig file:
- as a DataAbstract.daConfig file next to your application's executable
- as a DataAbstract.daConfig resource in your application's executable
- as a resource in RemObjects.DataAbstract.Server.dll
If your application does not provide a custom DataAbstract.daConfig, either as file or as embedded resource, the default configuration will be used from inside the Data Abstract dll.
Note: In most scenarios, you would use this Load method to load the configuration, as it provides the most flexibility. However, you can also use the LoadFromFile, LoadFromResource or LoadFromXml methods to load the configuration from a more specific location.
You can also call LoadFromResource without parameter, to have it look for a resource in your application's executable or the Data Abstract dll, but prevent a configuration from being loaded from an external file.
class method Load
static void Load()
Shared Sub Load()
Loaded
Returns a Boolean value indicating if the Configuration class has loaded a configuration file or resource, yet. A configuration must be loaded before a Data Abstract server application is ready to access data, usually using the parameter-less Load() method.
class property Loaded: Boolean read;
class Boolean Loaded { get; }
Shared ReadOnly Property Loaded() As Boolean
LoadFromFile
class method LoadFromFile
static void LoadFromFile()
Shared Sub LoadFromFile()
LoadFromFile (String)
Loads a Data Abstract configuration from the specified file. If the filename is empty, the configuration will be loaded from a DataAbstract.daConfig file next to your application's executable.
Note: LoadFromFile does not fall back to load the configuration from a resource if the file is not found; if the .daConfig cannot be located as specified, an exception will be thrown.
class method LoadFromFile(filename: String)
static void LoadFromFile(String filename)
Shared Sub LoadFromFile(filename As String)
Parameters:
- filename:
LoadFromResource
class method LoadFromResource
static void LoadFromResource()
Shared Sub LoadFromResource()
LoadFromResource (String)
Loads a Data Abstract configuration from a resource in the application's executable. If your application does not provide a custom DataAbstract.daConfig as embedded resource, the default configuration will be used from inside the Data Abstract dll.
Note: You can also call LoadFromResource without parameter, to have it look for a resource in your application's executable or the Data Abstract dll, but prevent a configuration from being loaded from an external file.
class method LoadFromResource(resourceName: String)
static void LoadFromResource(String resourceName)
Shared Sub LoadFromResource(resourceName As String)
Parameters:
- resourceName:
LoadFromXml
Loads a Data Abstract configuration from the specified file. If the filename is empty, the configuration will be loaded from a DataAbstract.daConfig file next to your application's executable.
Note: LoadFromFile does not fall back to load the configuration from a resource if the file is not found; if the .daConfig cannot be located as specified, an exception will be thrown.
class method LoadFromXml(xml: XmlDocument)
static void LoadFromXml(XmlDocument xml)
Shared Sub LoadFromXml(xml As XmlDocument)
Parameters:
- xml:
DatabaseProfiles
Provides access to all the database profiles known to the server application.
class property DatabaseProfiles: RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DatabaseProfile> read;
class RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DatabaseProfile> DatabaseProfiles { get; }
Shared ReadOnly Property DatabaseProfiles() As RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DatabaseProfile>
DataProviders
Provides access to all the ADO.NET providers known to the server application.
class property DataProviders: RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DataProviderInfo> read;
class RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DataProviderInfo> DataProviders { get; }
Shared ReadOnly Property DataProviders() As RemObjects.Common.Collections.NamedObjectCollection<RemObjects.DataAbstract.Server.DataProviderInfo>
Loaded
Returns a Boolean value indicating if the Configuration class has loaded a configuration file or resource, yet. A configuration must be loaded before a Data Abstract server application is ready to access data, usually using the parameter-less Load() method.
class property Loaded: Boolean read;
class Boolean Loaded { get; }
Shared ReadOnly Property Loaded() As Boolean
Load
Loads a Data Abstract configuration using the default mechanism, which looks in several places for a valid .daConfig file:
- as a DataAbstract.daConfig file next to your application's executable
- as a DataAbstract.daConfig resource in your application's executable
- as a resource in RemObjects.DataAbstract.Server.dll
If your application does not provide a custom DataAbstract.daConfig, either as file or as embedded resource, the default configuration will be used from inside the Data Abstract dll.
Note: In most scenarios, you would use this Load method to load the configuration, as it provides the most flexibility. However, you can also use the LoadFromFile, LoadFromResource or LoadFromXml methods to load the configuration from a more specific location.
You can also call LoadFromResource without parameter, to have it look for a resource in your application's executable or the Data Abstract dll, but prevent a configuration from being loaded from an external file.
class method Load
static void Load()
Shared Sub Load()
LoadFromFile
class method LoadFromFile
static void LoadFromFile()
Shared Sub LoadFromFile()
LoadFromFile (String)
Loads a Data Abstract configuration from the specified file. If the filename is empty, the configuration will be loaded from a DataAbstract.daConfig file next to your application's executable.
Note: LoadFromFile does not fall back to load the configuration from a resource if the file is not found; if the .daConfig cannot be located as specified, an exception will be thrown.
class method LoadFromFile(filename: String)
static void LoadFromFile(String filename)
Shared Sub LoadFromFile(filename As String)
Parameters:
- filename:
LoadFromResource
class method LoadFromResource
static void LoadFromResource()
Shared Sub LoadFromResource()
LoadFromResource (String)
Loads a Data Abstract configuration from a resource in the application's executable. If your application does not provide a custom DataAbstract.daConfig as embedded resource, the default configuration will be used from inside the Data Abstract dll.
Note: You can also call LoadFromResource without parameter, to have it look for a resource in your application's executable or the Data Abstract dll, but prevent a configuration from being loaded from an external file.
class method LoadFromResource(resourceName: String)
static void LoadFromResource(String resourceName)
Shared Sub LoadFromResource(resourceName As String)
Parameters:
- resourceName:
LoadFromXml
Loads a Data Abstract configuration from the specified file. If the filename is empty, the configuration will be loaded from a DataAbstract.daConfig file next to your application's executable.
Note: LoadFromFile does not fall back to load the configuration from a resource if the file is not found; if the .daConfig cannot be located as specified, an exception will be thrown.
class method LoadFromXml(xml: XmlDocument)
static void LoadFromXml(XmlDocument xml)
Shared Sub LoadFromXml(xml As XmlDocument)
Parameters:
- xml: