Login Skip Navigation LinksWilsonORMapper > Forums Search
Demo Version Demo Version
Download and try for yourself a fully working demo version, including sample apps and documentation.  The only limitation is that the demo version only works inside the debugger.

PayPal Subscribe
Get It All for $50 USD:
WebPortal, ORMapper,
Source Code, All Updates
PayPal

User Login User Login
Log In
 
 
Reset Password

Wilson ORMapper Forums Wilson ORMapper Forums : Bugs & Issues : Sorting problem when "alias" != "field"

Date Post
6/19/2007 7:12:44 PM

I'm working on a demo that illustrates how WORM can be used in conjunction with the GridView/ObjectDataSource.  Anwyays, it appears that sorting doesn't work when the "alias" != "field"

Example:

<attribute member="id" field="ProductID" alias="Id" type="System.Int32" /> (in mapping.xml)

<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" /> (in asp:gridview)

The exception:

System.Data.SqlClient.SqlException: Invalid column name 'Id'.

But I don't get it!  The whole idea of the "alias" attribute is to abstract your object property names from the corresponding table column names ... WORM should be smart enough to use the "field" attribute irregardless of whether "alias" is used or not.

Am I missing something here???

Thanks - wayde