voa_class 使用 Telerik 库浏览数据库中的对象时出现相关异常

voa_class related exception while browsing through objects in DB, using Telerik libraries

Edit2:这个问题最初是关于如何浏览表格的问题,但后来变成了关于 Telerik voa_class 异常

的问题

Edit1:这个问题包含两种尝试做同一件事的方法。

我想做这样的事情:

var Obj1 = database.GetData<Class1>().First();
var Obj2 = database.GetData<Class1>().Next();

第一次尝试

Next()的想法就是简单的再拿一个。由于 Next() 方法不存在,所以我决定在这里尝试一下:

var Obj1 = database.GetData<Class1>().First();
var Obj2 = database.GetData<Class1>().Single(o => o.Name != Obj1.Name);

然而,这会产生一个奇怪的异常:

Telerik.OpenAccess.Exceptions.DataStoreException
  HResult=0x80131500
  Message=Row for OID GenericOID@87f2834a Class1 Id=2 NOTRES  is not in the hierarchy starting at <Namespace>.Class1 ('Class1s') (voa_class for row is ...)
  Source=Telerik.OpenAccess.Runtime
  StackTrace:
   at OpenAccessRuntime.ExceptionWrapper.Throw()
   at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.executeQueryAll(ApplicationContext context, ImmutableQueryDetails query, CompiledQuery compiledQuery, QueryParameters parameters, Int32 skip, Int32 take)
   at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getAllQueryResults(CompiledQuery cq, QueryParameters parameters, Int32 skip, Int32 take)
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.Resolve()
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize()
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam)
   at OpenAccessRuntime.ListEnumerator.setCurrent(Int32 _pos)
   at OpenAccessRuntime.ListEnumerator.Move(Int32 relative)
   at OpenAccessRuntime.ListEnumerator.MoveNext()
   at Telerik.OpenAccess.Query.TypedEnumerator`1.MoveNext()
   at Telerik.OpenAccess.Query.ExpressionExecution.PerformDatabaseQuerySingle[TResult,T](ChainedContext context, Expression expression, QueryableCategory before, Int32& found, Int32 elemAt, Boolean single, Boolean diffType)
   at Telerik.OpenAccess.Query.ExpressionExecution.PerformQuerySingle[T,TResult](ExpressionCutter cutter, MethodCallExpression mce, ChainedContext piece, QueryOptions options)
   at Telerik.OpenAccess.Query.Piece`1.ExecuteSingle[TResult](Expression expression)
   at Telerik.OpenAccess.Query.Piece`1.System.Linq.IQueryProvider.Execute[TResult](Expression expr)
   at System.Linq.Queryable.Single[TSource](IQueryable`1 source, Expression`1 predicate)
   at <CurrentClass>.<CurrentMethod>() in C:\...\<Source_Code>.cs:line 54
   at ...

第二次尝试

(第二次尝试基于。)

IQueryable<Class1> query = database.GetData<Class1>();
query.OrderBy(u => u.Id);
var Obj1 = query.First();

query = query.Skip(1);
var Obj2 = query.First(); <== this line gives me an exception.

作为例外,我得到了一个与第一个相似的。

这是关于什么的?

显然源代码是正确的,但数据库似乎有问题:
Class1 相对应的 table 包含一列 voa_class。该列的内容应为 <NameSpace_of_Class1>.Class1。如果还有其他东西,比如 <Whatever_NameSpace>.<AnotherClass><AnotherNameSpace>.Class1(就像我的情况),就会生成上述异常。