Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defining Insert/Delete/Update commands
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01245533
Message ID:
01246668
Vues:
24
Viv,

>I think I'm being particularly thick today :-{
>I want to define my own Insert/Update/Delete commands for the default mm dataaccessobject. Thought I saw how this was done in the Docs but can't find it (or, so far, work it out for myself)

If you want to create a custom default data access class, you can do the following:

  1. Create a subclass of the appropriate data access object. For example, if you want to modify the default SQL Server data access class, right-click your business object project and select Add | New Item from the shortcut menu. In the Add New Item dialog's Categories pane, select MM .NET. In the Templates pane select MM .NET SQL Server Data Access. Change the name of the new data access class in the Name text box (for example, myDataAccessSql.cs), then click the Add button.

  2. Make your modifications to the new data access class

  3. To make sure your specialized data access class is instantiated at run time, override the corresponding data access factory method in your application's Factory class.

    For example, in C#:
    public override mmDataAccessSql CreateDataAccessSql()
    {
       return new myDataAccessSql();
    }
    And in VB .NET:
    Public Overrides Function CreateDataAccessSql() As mmDataAccessSql
       Return New myDataAccessSql()
    End Function
  4. If you are using the Business Layer Generator to generate custom data access classes, the next time you run it, set your custom data access class as the Data Access Object Base Class on the Data Access Layer Options page. The next time you run the BLG, it will remember this setting.


Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform