2. ElementaryDatabase

Provides database information to be used by the assembly

Example:

[assembly:ElementaryDatabase(Name="Northwind",
                             ConnectionString="Data Source=localhost; Initial Catalog=northwind; User ID=sa; Password=; Trusted_Connection=false;",
                             OledbConnectionString="Provider=sqloledb;Data Source=localhost; Initial Catalog=northwind; User ID=sa; Password=;"]

Remarks

Name, ConnectionString and OledbConnectionString are mandatory. You can set the values for these properties using your config file rather than hard-coding them.

Example:

[assembly:ElementaryDatabase(Name=ConfigurationManager.AppSettings["dbName"],
                             ConnectionString=ConfigurationManager.AppSettings["dbConnectionString"],
                             OledbConnectionString=ConfigurationManager.AppSettings["dbOledbConnectionString"]]

Options

CreateDynamicClassesWhen set to true, Elementary will create a DynamicObject for each table in the database.
[assembly:ElementaryDatabase(Name=ConfigurationManager.AppSettings["dbName"],
                             ConnectionString=ConfigurationManager.AppSettings["dbConnectionString"],
                             OledbConnectionString=ConfigurationManager.AppSettings["dbOledbConnectionString"],
                             CreateDynamicClasses=true]