Configuration Class

From RemObjects Software

Jump to: navigation, search

This is a Data Abstract Architecture entry
Feel free to add your notes to this topic below.



Overview (.NET)

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.


Namespace

Declaration (C#)

public static class Configuration;

Hierarchy

  • RemObjects.DataAbstract.Server.Configuration

Properties

Property
Type
Description
DatabaseProfiles NamedObjectCollection<DatabaseProfile> Provides access to all the database profiles known to the server application.
DataProviders NamedObjectCollection<DataProviderInfo> Provides access to all the ADO.NET providers known to the server application.
Loaded Boolean 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.


Methods

Method
Description
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.

LoadFromFile 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.

LoadFromResource 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.

LoadFromXml Loads a Data Abstract configuration from the specified XmlDocument.

Use this method if you want to obtain the configuration by other means than from a local file or a resource.


See Also


Product: RemObjects Data Abstract
Current version: Data Abstract 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToDriversComponentsToolsSamplesArticlesArchitectureIssues

Personal tools