Adapter ClassMVC+ (Model-Facade-View-Controller) Framework for ASP.NET
The Database adapter abstract class.
Inheritance Hierarchy

System Object
  NovaDimension.Data Adapter
    NovaDimension.Data.MySQL MySQLAdapter
    NovaDimension.Data.Oracle OracleAdapter
    NovaDimension.Data.SQLServer SQLServerAdapter

Namespace: NovaDimension.Data
Assembly: NovaDimension.Data (in NovaDimension.Data.dll) Version: 4.0.204.0 (4.0.0204.0)
Syntax

public abstract class Adapter : IAdaptable
Examples

This sample shows how to use the Adapter class.
See Also: DbConfig, Connector, LogHelper T 
using system;
using NovaDimension.Component;
using NovaDimension.Data;

class TestClass()
{
    static int Main()
    {
        DbConfig config;
        IFactoryable<IConnectionable, DbCfg> factory;
        IConnectionable connector;
        Adapter adapter;

        try
        {
            LogHelper<SQLServerAdapter>.DebugBegin(System.Reflection.MethodBase.GetCurrentMethod().Name);

            // Connecting to UserManager database
            config = (DbConfig)SerializeHelper.Deserialize("\\Config", "DbConfig.config");
            factory = DatabaseFactory.CreateFactory(config.UserManager);
            connector = factory.CreateProduct(config);
            connector.InitConnection();
            connector.Open();

            // Creating adapter
            adapter = connector.CreateAdapter();

            adapter.Command.Transaction = adapter.Connection.BeginTransaction();
            ...
            adapter.Command.Transaction.Commit();
        }
        catch (ExceptionEx<DatabaseFactoryException> ex)
        {
            Console.WriteLine(ex.Message);
        }
        catch (ExceptionEx<ConnectorException> ex)
        {
            Console.WriteLine(ex.Message);
            adapter.Command.Transaction.Rollback();
        }
        catch (ExceptionEx<AdapterException> ex)
        {
            Console.WriteLine(ex.Message);
            adapter.Command.Transaction.Rollback();
        }
        finally
        {
            connector.Close();
            LogHelper<SQLServerAdapter>.DebugEnd(System.Reflection.MethodBase.GetCurrentMethod().Name);
        }
    }
}
See Also