Sunday, November 18, 2007

I made a blog post a while ago in a thread entitled "Microsoft ruined data binding in ASP.NET 2.0 when they dropped component support from the design surface" and thought it worthy of a follow up.

ICustomTypeDescriptor

In order to allow strongly typed entities to tack on dynamic properties (extra columns brought back via a dynamic query) for data binding in ASP.NET data grid scenarios you must implement the ICustomTypeDescriptor interface. Since our latest release (v1119) supports joins it is now common to bring back extra columns for display purposes in EntitySpaces. Well, we implemented the ICustomTypeDescriptor interface on our esEntity class and it worked perfectly in ASP.NET, however, testing then showed it broke data binding in certain Windows.Forms scenarios. Why? There is a BUG in the Microsoft.NET Framework. It's not like bugs are not found in EntitySpaces of course, this is merely an explanation of how we have arrived to this point.

We have a few ways to work around the issue. One is to use our Collection.LowLevelBind() method and the other is adding properties to your entity (not very attractive). Our esDataSource control allows you to bring back extra columns and it binds just fine, there is a "LowLevelBind" method on the esDataSource for just this scenario. This only effects ASP.NET as Windows.Forms uses ITypedList which works like a champ (in hierarchical mode also).

HierarchicalDataSourceControl

The new HierarchicalDataSourceControl binding set of interfaces proved utterly incapable of displaying a hierarchical object model. We had it "kind of working" when we realized that this new binding model only supported a single parent/child relationship. This means it cannot display the EntitySpaces hierarchical object model. So, we withdrew the implementation of this feature. Scott Piegdon has a code sample on CodeProject, you can see his response to my "Ya, Butt" comment which validated my suspicions (nice article by the way).

Summary

Again, the new Microsoft ASP.NET data binding has proven to be flawed. It is next to impossible to support both ASP.NET and Windows.Forms binding with the same codebase due to a serious bug in the .NET Framework. Also, the HierarchicalDataSourceControl implementation suffers from a lack of foresight by its designers.

And finally (whining here) this all worked in the Microsoft .NET 1.x framework, see Part One as to how we got to where we are. The same ITypedList implementation worked for both ASP.NET and Windows.Forms. However, it was swapped out for some crazy DataSource model that is clearly geared for heavily reflected architectures. Well, EntitySpaces didn't take the bait. We are still 100% reflection free. We still run in "Medium Trust" and yes, we support the DataSource control but not the HierarchicalDataSourceControl. We have a plan to work around this issue entirely in a future release.

EntitySpaces

From mobile devices to large scale enterprise solutions in need of serious transaction support, EntitySpaces can meet your needs. Whether you’re writing an ASP.NET application with medium trust requirements, or a Windows.Forms application, the EntitySpaces architecture is there for you. EntitySpaces is provider independent, which means that you can run the same binary code against any of the supported databases. EntitySpaces is available in both C# and VB.NET. EntitySpaces uses no reflection, no XML files, and sports a tiny foot print of less than 200k. Pound for pound, EntitySpaces is one tough, dependable .NET architecture.

The EntitySpaces Team
--

EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net

posted on Sunday, November 18, 2007 9:24:47 PM (Eastern Standard Time, UTC-05:00)  #   
 Saturday, April 28, 2007

The esDataSource in this weekends beta can automatically handle sorting for all databases and paging for those databases which have built in paging support (SQL 2005, Oracle and MySQL). If you have been experimenting with our esDataSource we encourage you to upgrade this weekend when the new beta becomes available.

The sample ASP.NET web form below uses Northwind's Employees table and takes advantage of the built in paging capablities of EntitySpaces which in SQL 2005 uses the ROW_NUMBER function. Why Microsoft chose this syntax over the MySQL syntax for paging is hard to fathom. However, you wont have to worry about that as EntitySpaces takes care of this for you. The nice thing about the web form below is that it required almost no coding whatsoever and handles sorting and paging automatically. The TextBox is populated with the text from the EntitySpaces esDynamicQuery.es.LastQuery property each time data is fetched from the database so we can see the actual query.

The page above can also edit, delete, and save the data without writing any code as well. And more importantly, the GridView was setup entirely in design mode. The esDataSource runs just fine in Medium Trust mode as well, you'll find most DataSourceControls do not as they use heavy reflection unlike the EntitySpaces DataSource which uses NO REFLECTION.

So how did we build it?

Let's start from the beginning.

Add the esDataSource assemblies to your project

  1. EntitySpaces.Web.dll
  2. EntitySpaces.Web.Design.dll

Getting esDataSource in your Toolbox

After adding the two assemblies mentioned above (or projects if you have purchased the source code) you should be able to recompile and see the esDataSource show up on your toolbox. If you do not see it you might have to close and reopen Visual Studio. If you still do not see the esDataSource in your Toolbox you can always right mouse on your Toolbox and choose Add Tab to add a new tab. Once you have given your tab a name "right mouse" on the tab and select Choose Items  and browse to the EntitySpaces assemblies folder and click on the EntitySpaces.Web.dll. The assemblies can be found here:

The Trial Version Assemblies
C:\Program Files\EntitySpaces\EntitySpacesDemo\EntitySpacesDemo\Runtime

The EntitySpaces Developer Assemblies
C:\Program Files\EntitySpaces\Redistributables

Design Time Setup 

This is what our final page looks like in design time, notice we have our esDataSource control and a TextBox on the form. The entire page took less than 5 minutes of setup and design time.

Choosing columns

Notice in the image below that we have pointed to our class library named BusinessObjects.dll as the assembly that contains the EntitySpaces collection(s) we desire to use. You might not 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 to an assembly. However, if you have your esEntityCollection in a class library you will need to browse to that assembly or DLL. Reflection is used to populate this information however this reflection is in the EntitySpaces.Web.Design.dll which is not used at runtime. This brings up a tricky issue regarding new .NET 2.0 file based projects. "What assembly do 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 Angry 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 however considering the time you can save.

Tying the GridView to the esDataSource

Right mouse on your GridView and choose "Show Smart Tag". Set the esDataSource and the DataSource and in this sample we enabled all of the other options. 

After this you can go into the normal GridView designer dialogs and reorder the columns and set other properties.

Implementing a few key esDataSource Properties and Events

If you select your esDataSource and look at the properties you can set the AutoPaging and AutoSorting properties to True. However, you will need SQL 2005, Oracle, or MySQL in order for AutoPaging to work.

Now let's hook up some events.

We only truly need two events, the esCreateEntity and esSelect. For a grid that doesn't allow editing then only the esSelect event is needed. The esPostSelect event is needed to populate the TextBox with the esDynamicQuery.es.LastQuery text which will be explained below.

First, since we have decided to use Paging we need to tell the esDataSource how many rows are in the data that we are browsing. Don't let the code below confuse you. All we are doing here is using our single entity, Employees to get the total row count and assign it the esDataSource.TotalRowCount property, we only have to do this one time. If we add or delete rows of course we should adjust it. We also set the default sorting on the grid which is important as well. Remember, using the built in paging of the database itself means we don't actually return all of the rows, we only return as many rows as we show on each page, this is why this type of paging is very fast even with mega resultsets.

protected void Page_Load(object sender, EventArgs e)
{
    if (!this.Page.IsPostBack)
    {
        Employees emp = new Employees();
        emp.Query.es.CountAll = true;
        emp.Query.es.CountAllAlias = "Count"
        if (emp.Query.Load())
        {
            esDataSrc.TotalRowCount = (int)emp.GetColumn("Count");
        }

        gridView.Sort(EmployeesMetadata.PropertyNames.LastName, SortDirection.Ascending);
    }
}

esSelect

Okay, Let's look at what is required for our esDataSrc_esSelect event which is used to provide the data for the esDataSource.

protected void esDataSrc_esSelect(object sender, esDataSourceSelectEventArgs e)
{
    EmployeesCollection coll = new EmployeesCollection();

   // Assign the esDataSourcSelectEvenArgs Collection property
    e.Collection = coll;
}

Yes, it's that easy. You can have a fully sortable, pageable grid with no more than those few lines of code.

Notice that all had to do was create our collection and assign it to the esDataSourceEventArgs.Collection property. We don't use any Where condition in this example. However, if we did need to use them we would simply use the coll.Query.Where() method to assign them. However, and this is important. If you set the esDataSource to use either AutoPaging or AutoSort you DO NOT load the collection via Query.Load() or LoadAll(). The reason is that the esDataSource itself is going to apply the OrderBy properties for sorting  and or PageSize/PageNumber properties for paging and then call Query.Load() on your collection.

esCreateEntity

If you allow editing in your grid then you need to provide the esCreateEntity event, here is our esDataSrc_esCreateEntity event.

protected void esDataSrc_esCreateEntity(object sender, esDataSourceCreateEntityEventArgs e)
{
    Employees entity = new Employees();

    if (e.PrimaryKeys == null)
        entity.AddNew();
    else
   
    entity.LoadByPrimaryKey((int)e.PrimaryKeys[0]);

    // Assign the Entity
    e.Entity = entity;
}

esPostSelect

Finally, we want to display the actual query that is run each time the esDataSource populates the grid for curiousity reasons. Since we don't call Query.Load() ourselves we need to implement the esPostSelect event and gain access the loaded collection there.

protected void esDataSrc_esPostSelect(object sender, esDataSourceSelectEventArgs e)
{
    this.txtLastQuery.Text = e.Collection.es.Query.es.LastQuery;
}

That's it. Those four methods are all that is required to make our page handle sorting, paging, editing, modifying and save the data.

Don't worry, if you're not using a database that provides built in paging you can still do paging, but you will have to provide custom paging logic, however, the esDataSourceSelectEvenArgs does provide you with the PageNumber and PageSize prefilled in, you just have to fetch the data correctly.

esDataSource "State"

The esDataSource now makes it very easy for you to deal with postbacks. There is a property named "State" which is a Hashtable that you can use to store things in (not just strings either, anything that is serializable). The nice thing is the Hashtable (esDataSource.State) lives accross postbacks. This can be handy when you desire to trap the gridView_SelectedIndexChanged event and pass the id or id(s) to another esDataSource to use, an example would be a FormView or DetailsView control.

protected void gridView_SelectedIndexChanged(object sender, EventArgs e)
{
    this.esDataSrc.State["EmployeeID"] = this.gridView.SelectedDataKey.Value;
}

This is a glimpse of what is coming in this weekends ES 2007 beta. Also, for Windows.Forms we now fully support the INotifyPropertyChanged event which you can choose on the Generated Template's "Advanced Tab".

Upon release of the official EntitySpaces 2007 there will a very complete PDF manual documenting our esDataSource control.

 

The EntitySpaces Team
--

EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net



posted on Saturday, April 28, 2007 10:03:08 AM (Eastern Standard Time, UTC-05:00)  #   
 Sunday, April 08, 2007

Our next beta will have, among other things, paging built right into the EntitySpaces architecture. The EntitySpaces dynamic query API has two new properties, StartRow and PageSize. Here is a very simple dynamic query that uses these two new properties. This feature will be built into all providers for databases that support some sort of built in paging. The example below uses the EntitySpaces.SqlClientProvider and only works on SQL 2005 as it takes advantage of the new ROW_NUMBER() function in SQL 2005.  

EmployeesCollection coll = new EmployeesCollection();
coll.Query.Select(coll.Query.LastName, coll.Query.FirstName);
coll.Query.OrderBy(coll.Query.LastName, esOrderByDirection.Ascending);
coll.Query.es.StartRow = 25;
coll.Query.es.PageSize = 10;
if(coll.Query.Load())
{
     Console.WriteLine(coll.Query.es.LastQuery);

Notice that we print the Query's LastQuery property. EntitySpaces always provides the raw text back from a query for debugging purposes. Let's take a look at the SQL generated and executed by EntitySpaces. 

WITH [withStatement] AS
(
    SELECT [LastName],[FirstName] , ROW_NUMBER() OVER( ORDER BY [LastName] ASC) AS ESRN FROM [Northwind].[dbo].[Employees]
)
SELECT [LastName],[FirstName] FROM [withStatement] WHERE ESRN BETWEEN 25 AND 34

Now that we have paging built into the EntitySpaces architecture our new esDataSource control for ASP.NET will expose a PageSize property that you can set. The esDataSource control will then perform all of the paging logic for you automatically. You will be able to build sortable pages that can add, edit, and delete and page through data in a matter of minutes.

 

The EntitySpaces Team
--
EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net/

posted on Sunday, April 08, 2007 7:35:34 PM (Eastern Standard Time, UTC-05:00)  #   
 Sunday, March 11, 2007

Work is coming along quite nicely on our ASP.NET Design Time support for EntitySpaces 2007. Below is a screen shot of the EntitySpaces ASP.NET design time dialog that will allow you to setup your databinding mappings for grids, detail forms, and other controls in ASP.NET. Notice the image shows a GridView being bound to our new esDataSource control right within Visual Studio.

  

The esDataSourceDesigner control uses reflection to locate all of the classes derived from the EntitySpaces esEntityCollection class. However, the esDataSource uses NO reflection. The design time support is in a separate assembly that does not need to be present for runtime and therefore has no bearing on our medium trust support. The design time dialog will allow you to choose which collection to use in your binding. After choosing the desired collection you can then choose which columns to display.  Once you select "Ok" the grid will then add the columns you have chosen as bound columns and also populate the grid with some design time only data so you can see the layout.


The above image is what you will see when you select the "Columns" property in the GridView's options dialog. You can then further customize the order and all of the "normal things" in here as well. Also, Below you can see the DataKeyNames dialog being used to pick the primary keys in the grid.

And finally, EntitySpaces has taken a wiser path than some of the other implementations. The suggested approach by Microsoft is that folks build their queries in the dialog for updates, selects, deletes and so on? Thus, we would have had to have come up with some crazy "text based" query mechanism that is the equivalent of our dynamic query API. This is a non-starter. Instead, we provide a few key events that are called at the appropriate times that will allow you to use our familiar dynamic query API in code (as it should be).
 

Our esDataSource_Select even is used to create our CatagoriesCollection and then load it any way we see fit. We set the esDataSourceSelectEventArgs Collection property to our loaded collection.


protected void esDataSource_Select(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e)
{
    CategoriesCollection cats = new CategoriesCollection();
    cats.Query.Where(cats.Query.CategoryName.Like("%Candy%"));
    cats.Query.Load();

    e.Collection = cats;
}


There is currently only one other event that needs hooked up and that is the CreateEntity event. However, we are providing many more events that will allow you to fully customize everything if you desire to. However, you will only need to handle two or three events to have a fully editable grid or other control working with add/edit/delete functionality. This will be included in our next EntitySpaces 2007 beta. There are a few issues of course still that we are still working out but our thinking is this is really going to power-up your ASP.NET development.

The EntitySpaces Team
--
EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net/
posted on Sunday, March 11, 2007 12:18:55 PM (Eastern Standard Time, UTC-05:00)  #   
 Friday, August 04, 2006

We have released the first beta version of our EntitySpaces DotNetNuke ASCX Admin Grid Template Suite. Check out the demo here.

Here is an overview of the features:

  • All of the databases supported by EntitySpaces should work with these templates
  • The ASCX controls generated build upon your already created EntitySpaces Classes
  • Both C# and VB.NET ASCX controls can be generated*
  • The look and feel of the ASCX controls are managed by a very simple style sheet
  • The generated ASCX controls use the new ASP.NET MultiView/View controls
  • Browse, Detail, Edit, and Search modes can be generated automatically
  • You control what columns to display and in what order
  • All column headers are clickable and sort the GridView(s)
  • Required fields use the ASP.NET RequiredFieldValidator control
  • Foreign Keys are mapped to Url's in detail mode and combo-boxes in edit mode
  • Relationships can be mapped to subgrids in detail mode

*During the beta period there will only be a C# version. After user testing, if no issues arrise we will create the VB version. Both Versions will be available to all customers.

Files

The template is installed into the EntitySpaces\C#\Web and EntitySpaces\VB\Web folders respectively in MyGeneration. GridLoader.zip the DotNetNuke module that loads the generated ASCX controls is installed in Program Files\EntitySpaces\DotNetNuke\C# and Program Files\EntitySpaces\DotNetNuke\VB respectively.

Usage

  1. Add the needed EntitySpaces assemblies, and web.config entries to your DotNetNuke portal. For detailed instructions on how to do this see here.
  2. Install the GridLoader.zip DotNetNuke module like you would any other. Because we are using the new dynamic compilation model of ASP.NET 2.0 you must also add the directoryName key to the codeSubDirectorySection of your web.config as seen below(this is only necessary if you are using the C# version). You will see a commented out example in the appropriate location of your web.config if you have never done this before.

    <codeSubDirectories>
         <add DirectoryName="GridLoader" />
    </codeSubDirectories>

  3. Generate your EntitySpaces classes for your tables/views just like normal and upload them to /App_Code/GridLoader/Custom and /App_Code/GridLoader/Generated
  4. Generate your ASCX controls and upload them to /DesktopModules/GridLoader/
  5. Think about how easy EntitySpaces makes your life and have a beer.

You will find a new installer for this template suite on the downloads page under the products menu entry. This template suite will not be lincluded in the trial version of EntitySpaces. These templates are intended to provide the ability to administer databases over the web from within your DotNetNuke portal. This chore is typically overlooked although it is really very needed. Such admin screens can eat up quite a bit of development time and they are much easier to generate, and change when your database schema does. The demo module on our site is 100% generated no hand coding was done.

These templates are not currently supported on the same level as the templates that generate the EntitySpaces classes. Work on the new features in the upcoming 1.5 release will take priority. That being said we will of course address an issues that might arise as time allows.

See the PDF file that describes the usage of ASPX version of the template. All functionality and operations are exactly the same for the DotNetNuke ASCX version, with the exception of the "Use Master Pages"option.

posted on Friday, August 04, 2006 12:43:23 PM (Eastern Standard Time, UTC-05:00)  #   
 Thursday, August 03, 2006

Vasilis of Think of Design and Scott rolled out the new EntitySpaces site design, and branding over the weekend, and we must say that we are very pleased with the results. The Think of Design team carefully listened to the design features we wanted and made useful suggestions to help us achieve the best online experience possible for our users. We would also add their prices are very reasonable, if you are looking for a one of DNN design we can without a doubt recommend their services. However the thing that impressed us the most was the after delivery service of Vasilis. After delivering the skin, logo, source files, etc he wanted to be involved with the application of the new design to the site, and made adjustments to get it just right for us. Let us know what you think of the new design, and a very special thank you to the Think of Design Team from all of us at EntitySpaces, you all rock;)

posted on Thursday, August 03, 2006 9:11:12 PM (Eastern Standard Time, UTC-05:00)  #   
 Tuesday, August 01, 2006

EntitySpaces 1.4.2

We have accumulated enough fixed and tested issues that we thought it was important to put out a maintenance release. The new downloads should be posted on Friday, August 4, 2006. We will announce their availability in the forums, once they are up. The following issues are addressed in this version:

  • Change Guid with default newid() to accept input for Saves for Microsoft SQL Server.
  • Add XML comment to LoadByPrimaryKey that warns if the template is run on a table with no primary key.
  • Trim invalid characters from aliases in esPlugin.
  • Add preliminary LINQ support.
  • AddNew rolls back for MySQL provider without error with InnoDb tables.
  • Error in MySQL stored procedure template comment if all fields are in the primary key.
  • IndexOutOfRangeException if the primary key(s) is(are) not the first column(s) in a table.
  • ASPX page template ignores Namespace.
  • Adding fks broke WebServices' serialization.
  • Do not over-write files when generating Custom Master classes.
  • Add using System.ComponentModel when not generating a single file.
  • Multi-line default values not generated correctly.
  • Remove Query.Load("OR") from compiled help and document Query.es.DefaultConjunction instead.
    The default conjunction for Query.Load() is "AND". You can change that with this:
    emps.Query.es.DefaultConjunction = esConjunction.Or;
    
  • Add QueryReset to Entities and EntityCollections.
    TestCollection collection = new TestCollection();
    
    // Get the LastName for active employees
    collection.Query.Select(collection.Query.LastName);
    collection.Query.Where(collection.Query.IsActive == true);
    collection.Query.Load();
    Assert.AreEqual(16, collection.Count);
    
    // These get added to the above.
    // Now we get LastName, FirstName
    // For active employees named "Costner"
    collection.Query.Select(collection.Query.FirstName);
    collection.Query.Where(collection.Query.LastName == "Costner");
    collection.Query.Load();
    Assert.AreEqual(3, collection.Count);
    
    // Reset the query and return all columns and all rows
    collection.QueryReset();
    collection.Query.Load();
    Assert.AreEqual(30, collection.Count);
    
  • Add Scale and Precision to esParameter for output parameters.
    public partial class AggregateTestCollection : esAggregateTestCollection
    {
        public void TestParamsWithScale()
        {
            esParameter myParam = new esParameter("Salary", 12.34);
            myParam.DbType = DbType.Decimal;
            myParam.Precision = 18;
            myParam.Scale = 2;
            myParam.Direction = esParameterDirection.Output;
    
            esParameters parms = new esParameters();
            parms.Add(myParam);
            parms.Add("FirstName", "Entity");
            parms.Add("LastName", "Spaces");
            this.ExecuteNonExec(esQueryType.StoredProcedure, "proc_esTestInsert", parms);
        }
    }
    

EntitySpaces 1.5

We have rescheduled the 1.5 release for the end of August. We understand that this delay is making it difficult, if not impossible, to fully evaluate the product. Installing the 1.4.2 maintenance release will assure that your Trial period does not run out before 1.5 is released. We are especially concerned for our existing customers who are counting on hierarchical support. But, we feel that meeting quality standards takes precedence over meeting deadlines. We will not release something with known bugs and "fix it as we go." When it is ready, 1.5 will be released only to our current customers as a Beta version. A Final version will be released for download by our customers, and as a Trial version to the general public, after we have received sufficient feedback, can be comfortable that it has been tested in a wide variety of environments, and have fixed any hidden issues. We appreciate your patience and believe it will be well rewarded, as the hierarchical API is shaping up very nicely.

  • Hierarchical support
  • Caching

Future Enhancements

We have not forgotten the other features requested. In fact, we are using a new issue tracking system that helps us keep tabs on over sixty items, from ObjectDataSource support to updateable Views. Rather than try to predict when these will be ready, our focus is on putting out a top-notch hierarchical release. As we get closer to delivering it, we will prioritize what we have and post a roadmap for 1.6 and beyond. The new system has already reduced the amount of administrative time we spend on tracking bugs and enhancements. That means more time is available to actually code on them :-)

The EntitySpaces Team

posted on Tuesday, August 01, 2006 1:21:27 AM (Eastern Standard Time, UTC-05:00)  #   
 Thursday, June 15, 2006

We have had some issues come up that we thought should not wait until 1.5 is released. This maintenance release should hold you over until then. The DataGridView binding issues were the toughest nut to crack. And, unfortunately, those changes will require you to regenerate the Generated Master for your classes.

NOTE: You must regenerate your generated classes with the Master Template

EntitySpaces - Release Notes for 1.4.1 

  • Added “Use Schema” checkbox to SQL Server Stored Procedures template. Default is un-checked (dbo).
  • Changed MySQL Stored Procedure template delimiters from $$ to //.
  • Changed the esEntityCollection.Item Property so that it is no longer obsolete.
  • Fixed SqlClientProvider so that AnsiString output parameters now have the correct size property for computed columns.
  • Fixed bug in QueryBuilder for all 4 providers. If a Like() expression was used in the Where() clause before an Equal(bool) expression, then the parameter type for the boolean was set to a string.
  • Added two protected Methods to esEntityCollection:
    • AssignPrimaryKeys - Assigns the underlying DataTable's 'PrimaryKey' data member using the primary keys as defined in the collection's associated esColumnMetadataCollection.
    • RemovePrimaryKeys - Removes the DataTable's 'PrimaryKey' information by setting it to null. Call this to undo AssignPrimaryKeys().
  • Added three Properties to esEntityCollection:
    • AllowEdit - Default is true. Setting this to false prevents the user from editing a row in a DataGridView.
    • AllowNew - Default is true. Setting this to false prevents the user from adding new rows in a DataGridView.
    • AllowDelete - Default is true. Setting this to false prevents the user from deleting rows in a DataGridView.
  • Fixed esEntityCollection IBindinglList AddNew, ApplySort, and esEntity BeginEdit, CancelEdit, EndEdit, AddNew. This fixes the editing or clicking around in a DataGridView bug.
  • Fixed an issue where Extended Properties were not being included in the collection if MultiProviderMode was set to true.
  • Fixed DeleteAll() so that it honors the Filter(). Only records matching the Filter criteria will be deleted.
  • Fixed a problem that ocurred if your PrimaryKey column was not the first column in the table metadata.
  • Added a specific Exception for when you call Save on an entity that is part of a collection. You must call Save on the collection.


EntitySpaces Trial Version: 

  • The SqlDemo has been replaced by a new and improved EntitySpacesDemo. A zipped version with the runtime references removed is available on the Documentation|Downloads page.


Documentation: 

  • Added entries in compiled help for the new methods and properties.


Note: See the Release Notes for 1.4.1 for detailed installation and upgrade insructions.

posted on Thursday, June 15, 2006 12:03:31 AM (Eastern Standard Time, UTC-05:00)  #   
 Monday, June 05, 2006

We have released the first version of our EntitySpaces Template Suite for ASP.NET. Try the DEMO

Here are the features:

  • All of the databases supported by EntitySpaces should work with these templates.
  • The ASPX pages generated build upon your already created EntitySpaces classes.
  • Both C# and VB.NET ASPX pages can be generated.
  • The look and feel of the ASPX pages are controlled by a very simple style sheet.
  • Master Pages are supported and optional (new with ASP.NET 2.0).
  • The generated ASPX pages use the new ASP.NET MultiView/View controls.
  • Browse, Detail, Edit and Search modes are supported.
  • You control what columns to display and in what order.
  • All column headers are clickable and sort the GridView(s).
  • Required fields use the RequiredFieldValidator control.
  • ForeignKeys are mapped to urls in detail mode and combo-boxes in edit mode.
  • Relationships can be mapped to subgrids in detail mode.

Simply generate your ASPX pages. Add them to your solution. Finally, add these files to your project. (The templates are installed to the EntitySpaces.C#.Web and EntitySpaces.VB.Web folders in MyGeneration. The files below are under WebTemplates in your EntitySpaces program folder.)

  • es_stylesheet.css
  • question.gif
  • GridBase.cs  - C# projects only
  • GridBase.vb  - VB.NET projects only

Both the installer and the DEMO site are available for download to all who have purchased EntitySpaces. See the download menu on the main EntitySpaces site. This new template suite will not be in the trial version. These templates are intended to provide the ability to administer databases over the web. This chore is typically overlooked although it is really needed. Such admin screens can eat up quite a bit of development time and they are much easier to generate. Other than the row of buttons at the top the demo site is 100% generated, no hand coding was done.

These templates are not currently supported on the same level as the templates that generate the EntitySpaces classes. EntitySpaces will not be bogged down in supporting these or allow them to effect the timing of our 1.5 release which is fundamental to our long term strategy. That being said we will of course address issues over time and fix things as time allows.

See the PDF file that describes the template(s) PDF

posted on Monday, June 05, 2006 10:57:32 PM (Eastern Standard Time, UTC-05:00)  #   
 Sunday, June 04, 2006

We have taken our soon to be released ASPX template suite and generated a site against the Microsoft SQL Northwind database. Nothing you will see on this site was hand coded (except for the row of buttons at the top and the URL link at the bottom - both on our master page). The ASP.NET templates are pretty sophisticated and are style sheet driven so please don't get hung up on the color scheme. We realize you probably wouldn't use these pages as your actual website but the ASP.NET pages do provide a nice admin system that sys-admins can use to administer your database and that developers can use during development. They also act as a very nice reference on how to use EntitySpaces in an ASP.NET application.

The EntitySpaces ASP.NET templates support master pages (optional), use the new Multiview/View construct and the GridView, allow for sorting on the header columns, paging, sub grids, editing, searching, and more. We're only a matter of days until they are released at which point all customers will have access to the templates in the download area. The EntitySpaces ASP.NET templates will not be included in the trial version of EntitySpaces. The documentation and demo site of course will be open to everyone.

Take a look http://www.entityspaces.net/thedemo/Employees_admin.aspx

posted on Sunday, June 04, 2006 1:49:34 AM (Eastern Standard Time, UTC-05:00)  #   
 Tuesday, May 23, 2006

We just posted a video here to illustrate how simple it is to use EntitySpaces for module development on the DotNetNuke 4.x platform. This gets you up to where our standard code generation video starts with generating your EntitySpaces objects. We do plan to post an additional code generation video specifically for DotNetNuke in the near future, so stay tuned.

posted on Tuesday, May 23, 2006 7:06:40 PM (Eastern Standard Time, UTC-05:00)  #   
 Saturday, May 20, 2006

EntitySpaces release 1.5 currently has a soft target date of July 30th, 2006. We will keep you posted as we get closer to release. The list below is what we are planning for 1.5. Of course, any bug fixes will be included. The ASPX template will be released as soon as it is available, possibly as early as mid-June.

  • Hierarchical support. This is the number 1 priority for this release. It is no small thing and will support many-to-one, one-to-many, and many-to-many relationships,  DataBinding Sub-Collections, and lazy loading. 
  • Caching. There has been a great deal of interest expressed in caching. This will eliminate unnecessary trips to the database while avoiding duplicate objects in memory. It will be well integrated with our hierarchical plans.
  • ASPX template. The template generates pages using the GridView control. This will be an amazing template with very sophisticated features:
    • Versions for both C# and VB output.
    • Sorting, filtering, searching, and editing.
    • Detail pages with hyperlinks to related objects.
    • DropDown ComboBoxes for lookups. You can choose the display column or even define your own concatenation of columns.
    • Paging with user definable number of line items per page.

We have a growing wish list of items for inclusion in future releases. We have not prioritized them, yet, and some may never see the light of day, but feel free to comment on them and add your own:

  • Ability to load a table-based EntitySpaces object from a View. Similar to dOOdads.
  • Improved DataBinding.
  • Add a Clone method to the single entity.
  • Additional Providers.
  • Implement an .IsLoaded() method for entities and collections.
  • .NET Remoting.
  • WinForm templates.
  • Dynamic Query enhancements:
    • Support for common functions like UPPER() in WHERE clauses.
    • Support for JOINs.
  • Some tough ones. These are particularly thorny, especially in a multi-db environment, but we are still considering them as worth-while suggestions:
    • Updateable Views.
    • Add the ability for the EntitySpaces Dynamic Query API to do more than SELECT statements, such as INSERT, UPDATE and DELETE statements.
    • Add the ability to generate EntitySpaces objects from Stored Procedures (as opposed to just Views and Tables).

If your pet feature has not made the list, do not be discouraged. Just let us know what you want in the forums or by commenting on this post. And, don't let that stop you from using EntitySpaces 1.4 right now. It can replace tens (even hundreds) of man-hours of repetitive drudgery with well-tested, high-quality code. You are free to concentrate on the aspects of a project that make it unique. Ask yourself, "What price would I pay if I could spend more time with my family and friends?" Then, let your conscience be the guide.

The EntitySpaces Team


posted on Saturday, May 20, 2006 8:37:34 AM (Eastern Standard Time, UTC-05:00)  #   
 Saturday, May 13, 2006

 

EntitySpaces 1.4 initially was targeted for May 31st, however, we had to make some adjustments. Hierarchical support is now the main focus of our next release (1.5). Also, the ASPX templates are still underway and will be released separately before the 1.5 release. We had also planned on doing some databinding work as well but that has been pushed to 1.5 as well. However, all that said this is a terrific release, we have some very good features, a few fixes, and even a new MySQL provider in 1.4. See the release notes below for the details.         


·          EntitySpaces 1.4

o         Added templates to provide full VB.NET support

§          Includes a full set of Custom, Generated, and MetadataMap templates.

§          It is no longer necessary to pre-compile the generated code under C#.

§          Note: If you are using VBExpress, we recommend opening your Project Properties, selecting the Application properties tab, and clearing the Root namespace that the IDE set by default. That way, when you add “Imports BusinessObjects” to your code, it will work as expected.

o         Added an EntitySpaces provider for MySQL.

§          Works with MySQL 4.x using DynamicSql mode.

§          Works with MySQL 5.x and supports both DynamicSql and StoredProcedure modes, as well as Views.

o         Added an EntitySpaces Template to produce MySQL 5.x stored procedures.

o         Fixed stored procedure parameter name prefix handling for SQL Server, Oracle and Access.

o         Fixed parameter name handling for column names with spaces.

o         Added output parameter support to esParameters.         

public string GetFullName(int employeeID)
{
   
esParameters parms = new esParameters();

   
parms.Add("EmployeeID", employeeID);
   
parms.Add("FullName", esParameterDirection.Output, DbType.String, 40);

   this.ExecuteNonExec(esQueryType.StoredProcedure, "proc_GetEmployeeFullName", parms);

   return parms["FullName"].Value as string;
}

o         Fixed an obscure bug in Transaction Manager. (Special thanx to Graham Scragg and Thomas Coats for working with us on this.)

o         Improved Exception handling. We no longer wrap the exceptions which will make it much easier for you to see the real exception.

o         Updated and improved compiled help.

 

 

·          DotNetNuke

o         Includes an EntitySpaces ControlPanel module for DotNetNuke.

§          Displays EntitySpaces assembly information.

§          Allows you to upload/update EntitySpaces assemblies.

§          Allows you to encrypt/decrypt connection information in config files.

o         Added new template to create Sql scripts for DotNetNuke module development.


 

·          ASP.NET

o         Includes ASP.NET code for an EntitySpaces ControlPanel.

§          Displays EntitySpaces assembly information.

§          Allows you to update EntitySpaces assemblies.

§          Allows you to encrypt/decrypt connection information in config files.


 

·          EntitySpaces SqlDemo

o         Includes code demonstrating encrypting/decrypting app.config connection information.

o         Note: If SqlDemo is run from within Visual Studio, SqlDemo.vshost.exe.config gets encrypted. This file is only used by Visual Studio and should never be distributed with your application. To encrypt SqlDemo.exe.config, run SqlDemo.exe directly from the bin\Debug folder.


 

·          EntitySpaces Test Suite

o         Updated the test fixtures and added NUnit projects to test the EntitySpaces provider for MySQL.

o         Duplicated the C# tests in VB.

Note: Installation instructions at the bottom of the Release Notes for 1.4 contain special instructions for MySQL users. They explain how add the required Language Mapping to MyGeneration.


posted on Saturday, May 13, 2006 11:49:34 AM (Eastern Standard Time, UTC-05:00)  #   
 Thursday, May 11, 2006
In order to facilitate further simplification of the setup/upgrading of EntitySpaces in your DotNetNuke portal or plain ol' ASP.NET application we are please to announce that we will also release the EntitySpaces Control Panel.


This module/page will show you what EntitySpaces assemblies you have available and the versions of those assemblies. It will also allow you to upload assemblies when you are ready to update EntitySpaces. Lastly, and perhaps the coolest feature, is that this module will actually encrypt/decrypt the EntitySpaces connection info section of your web.config for you. We are just putting the finishing touches on the 1.4 drop and starting to package everything up for distribution, so you can expect to see this soon. We will have a DotNetNuke installable version, as well as an aspx page you can use in your ASP.NET projects. Winformers? Don't think we forgot to spread the love around, in the SqlDemo we have also added the encryption routines so that you can add this to your winform applications if you should so desire.


posted on Thursday, May 11, 2006 9:29:56 AM (Eastern Standard Time, UTC-05:00)  #