Hi Guys
Having a problem with the ASP.NET ASCX Web Admin template EntitySpaces_C#_WebAdmin.csgen. Using ES 2008.1.927.1 and MyGeneration 1.2.0.7 and the Northwind db running on SQL Express.
If you use a view in the browse tab, the same view is used to populate the columns list in the search tab. This makes sense except the generated code is using the base table and not the view. This will cause errors when to select a column that is not in the source table.
To test it I used a fresh set of business objects created from the Northwind database then selected the Orders table as the source in web admin template using the Orders_Qry view in the browse tab. In the search tab I selected the CompanyName field which comes from the parent Customers table.
The code snippets below from Orders_admin.ascx.cs show LoadGrid() method creates new instance of the OrdersCollection() and not the OrdersQryCollection(). Also LoadEntityForSeach() uses esOrdersQueryand not esOrdersQryQuery. This results in an error because q.CompanyName is not defined.
protected override void LoadGrid() { OrdersCollection coll = new OrdersCollection();
...
}
private void LoadEntityForSeach(OrdersCollection coll) { esOrdersQuery q = coll.Query; if(this.vdCompanyName.SelectedValue != "") { esWhereOperand op = (esWhereOperand)Enum.Parse(typeof(esWhereOperand), vdCompanyName.SelectedValue); q.Where(q.CompanyName.OP(op, this.vtCompanyName.Text, null)); } }
BTW Why is the gridloader project not part of the install anymore? I had to re-install ES 2007 to get it. An interesting side effect occured when recreating my business objects, I got Unknown datatypes all over the place. Uninstalling both versions and just installing ES 2008 sorted it but I thought it worth mentioning as I have seen a few posts about Unknown datatypes.
Cheers
Paul