Step 3: Specifying Local or WCF Data Access
There are several different ways you can specify which type of data access classes your business objects use to retrieve and manipulate data.
- You can add a DefaultDataAccessMode setting to your app.config or web.config file as shown here (currently, the only valid values are "local", "wcf" and "webservice") and set it to "wcf":
<appSettings> <!-- Specifies the default data acccess model: "local", "wcf" or "webservice" --> <add key="DefaultDataAccessMode" value="wcf" /> </appSettings>
- You can set mmAppBase.DefaultDataAccessMode programatically when your application first starts up.
For example, you may want to add an option to a Windows User Login form that allows the user to specify whether they want to connect locally or remotely:

In the handler for the radio buttons you can place code that sets the application's default access mode:
private void rdoLocalData_CheckedChanged(object sender, EventArgs e) { mmAppBase.DefaultDataAccessMode = mmDataAccessMode.Local; } private void rdoRemoteData_CheckedChanged(object sender, EventArgs e) { mmAppBase.DefaultDataAccessMode = mmDataAccessMode.WCF; } - You can also override a specific business object's CreateDataAccessObject() method to instantiate one or the other type of data access class.
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 07/07/09
Comment or report problem with topic
