Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to obtain IQueryable instance
Message
From
28/03/2018 09:07:37
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01659016
Message ID:
01659040
Views:
53
>>Hi,
>>
>>I am modifying a web page to use a different set of data for a DevExpress ASPXGridView control.
>>I created the new view, then created the new LINQ to SQL class, just as I remember doing for the previous data.
>>Now I am getting this error and have no idea what is wrong:
>>
>>
 Unable to obtain IQueryable instance from 'RESREPRICER.Web.DataClassesTransactionsSuccessDataContext'.'viewTransactionsSuccess' or Selecting event
>>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
>>
>>Exception Details: System.InvalidOperationException: Unable to obtain IQueryable instance from 'RESREPRICER.Web.DataClassesTransactionsSuccessDataContext'.'viewTransactionsSuccess' or Selecting event
>>
>>Source Error:
>>
>>
>>Line 15:             if (!IsPostBack)
>>Line 16:             {
>>Line 17:                 ASPxGridViewMain.ExpandRow(0);
>>Line 18:             }
>>Line 19:         }
>>
>>
>>Source File: D:\Development\VS2010\RESREPRICER_asp4\ReportAdmin1Success.aspx.cs    Line: 17
>>
>>Stack Trace:
>>
>>
>>[InvalidOperationException: Unable to obtain IQueryable instance from 'RESREPRICER.Web.DataClassesTransactionsSuccessDataContext'.'viewTransactionsSuccess' or Selecting event]
>>   DevExpress.Data.Linq.LinqServerModeDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +3966819
>>   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +22
>>   DevExpress.Web.Internal.DataHelper.PerformSelect() +222
>>   DevExpress.Web.Internal.GridDataHelper.PerformSelect() +286
>>   DevExpress.Web.ASPxDataWebControlBase.PerformSelect(String dataHelperName) +29
>>   DevExpress.Web.ASPxGridBase.DataBindNoControls() +82
>>   DevExpress.Web.ASPxGridView.ExpandRow(Int32 visibleIndex) +16
>>   RESREPRICER.Web.ReportAdmin1Success.Page_Load(Object sender, EventArgs e) in D:\Development\VS2010\RESREPRICER_asp4\ReportAdmin1Success.aspx.cs:17
>>   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
>>   System.Web.UI.Control.OnLoad(EventArgs e) +95
>>   System.Web.UI.Control.LoadRecursive() +59
>>   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678
>>
>>
>>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2623.0
>>
>>Can anyone help me understand this?
>
>https://www.devexpress.com/Support/Center/Question/Details/Q586117/aspxgridview-unable-to-obtain-iqueryable-instance-from-dataclassesdatacontext1-orders-or

I've worked out what I was doing wrong, but have no idea why!

When I look at the DataClass the view name is viewTransactionsSuccess.
However, if I write code like this:
            RESREPRICER.Web.DataClassesTransactionsSuccessDataContext db = new DataClassesTransactionsSuccessDataContext();
            e.KeyExpression = "GUID";
            e.QueryableSource = from viewTransaction in db.viewTransactionsSuccesses
                                select new
                                {
Note that the name has magically changed to viewTransactionsSuccesses

So once I changed my aspx markup to refer to that name, it works.

I have no idea what is going on here.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform