I've created a simple Custom View (vRequestList) to flatten out some of my objects for presentation in a GridView. The view itself works fine, I can retreive the entire collection fine. But I'm having problems when I try to get the view
results in a sorted and paged fashion. First and foremost, the stored procedure to the retreive the paged results does not seem to be getting generated (gen_vRequestListPagingSelect). This stored procedure is however mentioned in vRequestList.Generated.cs
in the override for StoredProcedureName. Do I have to do something special in the model to have this stored procedure generated?
Additionally, is there some technical reason using NHDAL, why views seem to have to be paged in a completely different fashion than regular objects/tables? To retrevie my request objects in a paged fashion I can do this (basically taken from
your page on paging):
RequestPaging paging = new RequestPaging(2, 10, (Request.FieldNameConstants)Enum.Parse(typeof(Request.FieldNameConstants), "RequestName"), true)
IList<Request> reqCol = RequestCollection.RunSelect(x => true, paging).ToList();
gvRequests.DataSource = reqCol;
The Enum parsing is needed becuase the sort columns come in as strings. Where RunSelect method can take a paging object, however the only way I've seemed to find to page view results has to use subdomains (of course I haven't got this to work
yet, becuase of the missing stored procedure). Something like this:
SubDomain subDomain new SubDomain();
subDomain.AddSelectComand(new vRequestListPagedSelect(2, 10, "RequestName", true, "");
vRequestListCollection reqCol = subDomain.GetCollection<vRequestListCollection>();
gvRequestsView.DataSource = reqCol;
Assuming the problem with the missing stored procedure can be resolved, is there some way to do this with a paging object? Not that it really matters, if the above will work, just curious? Thanks.