General information
Category:
The Mere Mortals .NET Framework
Title:
Error - Only Elements Allowed
Environment versions
Network:
Windows 2003 Server
I am evaluating MM to see if it will work with my data and application. I was trying to create a simple test Windows test form that mimics the way the example for Northwind works using my own SQL server data.
I know there must be something simple that I am missing. Any help will be greatly appreciated.
Thanks,
********************************************
Error Text:
********************************************
Only elements allowed (C:\FOIApps\MM Wintest 1\bin\Debug\MM Wintest 1.exe.config line 56)
********************************************************
********************************************************
Error occurs when calling the GetDataSet method
********************************************************
********************************************************
********************************************
my app.config has the following
********************************************
databases
add key="EPS\Connection" alue="server=electra;uid=XTEST;pwd=TESTPW;database=EPSquote;"
databases
This is a valid key since I have used it many times on this same machine when accessing the database.
********************************************
** Form Code
********************************************
public class ClaimantDetail : mmBusinessForm
{
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
private OakLeaf.MM.Main.Windows.Forms.mmDataGrid dgClaimant;
private MMWinTest1.Business.Claimant oClaimants;
private DataSet ds;
public ClaimantDetail()
{
this.oClaimants = (Claimant)this.RegisterPrimaryBizObj(new Claimant());
InitializeComponent();
ds = oClaimants.GetClaimantsByQuoteID(1);
dgClaimant.DataSource = ds;
InitializeComponent call
}
********************************************
Business Object is set up as follows
********************************************
*** Abusobject
using OakLeaf.MM.Main;
using OakLeaf.MM.Main.Business;
using OakLeaf.MM.Main.Security;
using OakLeaf.MM.Main.Managers;
namespace MMWinTest1.Business
{
public class ABusinessObject : mmBusinessObject
{
public ABusinessObject()
{
this.DatabaseKey = "EPS";
this.RetrieveAutoIncrementPK = true;
}
}
********************************************
*** Specific Business Object
********************************************
using System;
using System.Data;
namespace MMWinTest1.Business
{
public class Claimant : ABusinessObject
{
public Claimant()
{
this.TableName = "Claimants";
this.PrimaryKey = "iclaimant";
string aa = this.DataAccessClass;
this.UpdateSelectStatement = "SELECT * FROM " + this.TableName;
}
public DataSet GetClaimantsByQuoteID(int id)
{
string selcmd = "SELECT * FROM Claimants WHERE iquote = "+id.ToString();
return this.GetDataSet(selcmd,CommandType.Text);
}
}
}
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only