There are two new DLL's in your "Redistributables" folder, and these are:
- EntitySpaces.Web.dll
- EntitySpaces.Web.Design.dll
The Design time dll is needed only for design time and does not need to be shipped with your product, however, in testing we ask you to add references to both of them to your application.
The latest beta contains our new esDataSource for ASP.NET. It should show up in your Toolbox when in design mode and look like this. If you do not see it you can always right mouse on your Toolbox and choose Add Tab to add a new tab, once you've given your tab a name right mouse on the tab and choose Choose Items and browse to the EntitySpaces Redistributables folder which by default is located at "C:\Program Files\EntitySpaces\Redistributables". and click on the EntitySpaces.Web.dll.

Drag a GridView or a DetailsView or any number of other controls onto your form. Next drag an esDataSource onto your forum. Set the GridView's (or other controls) DataSourceID to your esDataSource. Next right mouse on your GridView and choose "Show Smart Tag" and from there you can choose "Configure Data Source" and you should be presented with a list of classes that are esEntityCollections. Paging is not yet supported, please don't check that yet or you wont see any data. The Smart Tag dialog will look like this:
After choosing "Configure Data Source" you will see something like this:
Notice in the above image we have browsed to a class library named BusinessObjects.dll, you might now have to do this depending on how your project is setup. If you have a traditional .NET 1.1 type of "Project" based web solution then you will probably see your esEntityCollections without browsing. However, if you have your esEnttiyCollection in a class library you will need to browse to that assembly or DLL. Reflection is used to populate this information. This brings up a particular tricky problem that should be fixed in the next beta, and that is, for the new .NET 2.0 file based solutions what assembly can we load? Well, for now our recommendation is for you to launch your web application without debugging it and browse to the app_code.dll. You will find it here:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\esdatabinding\8a81ff31\51684664\App_Code.fbpesify.dll
Kind of cumbersome we admit, in the above path esdatabinding is the name of the webapplication and you just kind of guess
on the other two, it's pretty easy though as there are only like one or two folders in those directories. It's well worth it.
Next you need to hook up two main events. Select your esDataSource and choose "Properties". Switch the events area using the lightening bolt and double click on esSelect and esCreateEntity. Your code in those events will be something like this:
The esSelect Event Handler
Code:
protected void EsDataSource1_esSelect(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e)
{
EmployeesCollection coll = new EmployeesCollection();
coll.Query.es.Top = 5;
coll.Query.Select
(
coll.Query.EmployeeID,
coll.Query.FirstName,
coll.Query.LastName
);
if (e.Arguments.SortExpression != null && e.Arguments.SortExpression.Length > 0)
{
coll.Query.OrderBy(e.Arguments.SortExpression, esOrderByDirection.Ascending);
}
coll.Query.Load();
e.Collection = coll;
}
The esCreateEntity Event Handler
Code:
protected void EsDataSource1_esCreateEntity(object sender, EntitySpaces.Web.esDataSourceCreateEntityEventArgs e)
{
Employees emp = new Employees();
if (e.PrimaryKeys == null)
{
emp.AddNew();
}
else
{
emp.LoadByPrimaryKey((int)e.PrimaryKeys[0]);
}
e.Entity = emp;
}
We haven't tested this with 3rd Party Grids yet, we wanted to get this beta out and get some feedback. We will be continuing to improve this of course and release improvements with our next beta. SQL CE and restoration of our VistaDB support are key to our next beta.
PLEASE DO NOT HIJACK THIS THREAD OR OTHERS ON THIS TOPIC, WE KNOW THIS IS GOING TO BE A WIDE AREA, SO PLEASE START YOUR OWN POSTS.
EntitySpaces |
Twitter |
BLOG | Please honor our Software License