Data Link and ORDER BY clause
I have been using a data link to access a one to many relationship. Since a fairly large number of records can get returned, I like to have the results ordered by a couple fields. Until recently I was able to use the Advanced button and modify my SQL query to include an ORDER BY clause. Now it doesn't work, perhaps with the 3.5 release. If I remove the ORDER BY clause, I don't get the error. I have verified that the syntax of my query is correct. Any suggestions out there or at least in the same boat? Error text is below.
Dave
Geocortex.Essentials.RestManager
Object reference not set to an instance of an object.
at Geocortex.Essentials.RestManager.Controllers.DataLinkWizardController.CreateWizardViewModel()
at Geocortex.Essentials.RestManager.Controllers.WizardController'1.WizardIndex(String buttonPressed, String currentStep, Nullable'1 finishSubWizard)
at Geocortex.Essentials.RestManager.Controllers.WizardController'1.Index(IList'1 submits, String currentStep, Nullable'1 finishSubWizard)
at Geocortex.Essentials.RestManager.Controllers.WizardController'1.Start()
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary'2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary'2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func'1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func'1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func'1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func'1 continuation)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList'1 filters, ActionDescriptor actionDescriptor, IDictionary'2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
-
Hi David,
We have verified this as an issue. From looking at your stack trace it looks as though you're trying to use the data link wizard (via the "Edit" button) to edit the data link as opposed to the advanced edit page (via the "Advanced" button). You should still be able to edit your data link through the advanced button. What's happening when you click on the edit button is it's trying to parse your query string into meaningful bits and pieces so that it can present you with a more "easy" UI, whereby you can just choose the columns you want, etc. I don't think this would have changed any for the 3.5 release. We can fix up the wizard so that it can safeley handle the orderby clause (as well as the having clause). The basic wizard isn't intended to be able to handle all possible SQL expressions, so it's still possible that even after this, you may type in SQL that it doesn't recognize. If this is the case, you'll still need to use the advanced page.
Jeff
0 -
Thanks for confirming Jeff. It would be nice if the basic tool would be able to handle the more simple and common clauses like ORDER BY. I usually write my own to get things the way I want. If nothing else, I think it should fail a little more gracefully- something like "Cannot parse this query. Please use the Advanced Tool to configure this link."
I thought this was causing the problem I had, but it turns out I had some layer changes that affected workflows on this layer.
Dave
0 -
Hi David,
I absolutely agree with your suggestions. I will add better support for order by, etc., as well as a more graceful error handling for being unable to parse more complex expressions.
Jeff
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
3 kommentarer