Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VistaDB Problem with Setup
Message
From
26/02/2005 01:19:36
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
25/02/2005 12:29:13
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00990409
Message ID:
00990843
Views:
27
Hello Donald,
I think you can chalk this one up to a copy and paste error!

Since CreateDataAccessObject is an mmBusinessObject method, it should have been pasted inside your ABusinessObject's class declaration and should look like this:
public class ABusinessObject : mmBusinessObject
{
	/// <summary>
	/// Constructor
	/// </summary>
	public ABusinessObject()
	{
		this.DatabaseKey = "FX";
		this.DataAccessClass =  "vistadb";
	}

	protected override OakLeaf.MM.Main.Data.mmDataAccessBase CreateDataAccessObject(string dataAccessClassName)
	{
		if (dataAccessClassName.ToLower() == "vistadb")
		{
			return new mmDataAccessVistaDB();
		}
		else
		{
			return base.CreateDataAccessObject (dataAccessClassName);
		}
	}

}
That's why you were getting that error. The compiler was telling you that the code was not in a class declaration. If you look at it again, you'll see the method was inside the namespace block instead.

Hope that makes sense,
---J

>Kevin,
>
>Actually the entire code block is quite short, so I have pasted it below, where "FX" is the name of an existing VistaDB database:
>
>using OakLeaf.MM.Main;
>using OakLeaf.MM.Main.Data;
>using OakLeaf.MM.Main.Business;
>using OakLeaf.MM.Main.Security;
>using OakLeaf.MM.Main.Managers;
>
>namespace dtc.fxsolution.Business
>{
>
>protected override OakLeaf.MM.Main.Data.mmDataAccessBase CreateDataAccessObject(string dataAccessClassName)
>{
> if (dataAccessClassName.ToLower() == "vistadb")
>{
> return new mmDataAccessVistaDB();
>}
> else
>{
> return base.CreateDataAccessObject (dataAccessClassName);
>}
>}
> ///
> /// Application-level Business Object class
> ///

> public class ABusinessObject : mmBusinessObject
> {
> ///
> /// Constructor
> ///

> public ABusinessObject()
> {
> this.DatabaseKey = "FX";
> this.DataAccessClass = "vistadb";
> }
> }
>
> /// summary
> /// Application-level Business Rule class
> /// /summary
> public class ABusinessRule : mmBusinessRule
> {
> /// summary
> /// Constructor
> /// /summary
> /// param name="hostObject">Host object> public ABusinessRule(ImmBusinessRuleHost hostObject)
> : base(hostObject)
> {
> }
> }
>}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform