in

Community

Take part in the community surrounding CodeBreeze and other products from SteelBlue Solutions.
Latest post 11-21-2008 8:34 PM by miguel. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-07-2008 4:00 AM

    Trying to create custom database connector

    I have a class defined as follows:
       public partial class MV1 : UserControl, IDatabaseConnector, IDisposable {

    This is in an assembly called CodeBreezeDataBaseConnector1.dll, in namespace Custom. The assembly has been copied to the same directory with CodeBreeze.exe and CBCon.exe.

    In CodeBreeze.exe.config I have the following element additions:

     <schemaProviders defaultProvider="Sql2005Provider">
        <schemaProvider name="MV1" type="CodeBreezeDataBaseConnector1.Custom,Custom.MV1"/>
     </schemaProviders>
     <databaseConnectors>
        <add key="MV1" value="CodeBreezeDataBaseConnector1.Custom,Custom.MV1"/>
     </databaseConnectors>
     <dataTypeMappers>
        <add key="MV1" value="SqlDataTypeMappings.xml"/>
     </dataTypeMappers>

    I know the attributes are defined incorrectly but I don't know how to correct it. I can see my MV1 provider when creating a new project, but I'm getting an error from database selection: System.ArgumentNullException: Value cannot be null. Parameter name: type
       at System.Activator.CreateInstance(Type type, Boolean nonPublic)

    Of course it can't find my Type, I just need to know the proper way to define it.

    TIA!

  • 11-21-2008 8:34 PM In reply to

    Re: Trying to create custom database connector

    I noticed nobody in the community was able to answer this question I'm sorry you had to wait so long.  You can send questions directly to support@steelbluesolutions.com and they'll be answered right away.

    The <schemaProvider> contains the name and type for the schema provider only, not the connector.  If you have a corresponding connector for the schema provider, you add an entry in <databaseConnectors> and make the key the same name as the schema provider name for which it corresponds.  Then the value should be the type of your connector.

    The problems I see above is that both the provider and connector types are the same, so CodeBreeze is trying to take the CodeBreezeDatabaseConnector1 class to the abstraction called SchemaProviderBase and cannot do so.  The original app.config will reflect correct configuration usage so study that one.

    For this and your future reference, your namespace and classes are also reversed there.  Standard .NET-type notation in strings need to follow the format: "Fully qualified class,assembly"  the fully qualified class means namespace and class name and I think you have it backwards there.  The assembly is listed without the "dll".

    I hope this helps.

    Miguel A. Castro
    CodeBreeze Chief Architect - SteelBlue Solutions

     

Page 1 of 1 (2 items)
2008 - All rights reserved
Powered by Community Server (Commercial Edition), by Telligent Systems