since we switched to the new version of dotConnect for Oracle 6.30.160 we get an NullReferenceException.
Here's the code snippet:
Code: Select all
var lv_result = (from c in lv_context.clsValidCustomerGroups
select new DTO.clsDropDownElement()
{
ID = c.CustomerGroupId,
Name = c.CustomerGroupName
}).OrderBy(p => p.Name).ToList();
If we do NOT create a new clsDropDownElement-object and use an anonymouse type, it works
Code: Select all
var lv_result = (from c in lv_context.clsValidCustomerGroups
select new
{
ID = c.CustomerGroupId,
Name = c.CustomerGroupName
}).OrderBy(p => p.Name).ToList();
Here's the stack trace:
Code: Select all
Exception: System.NullReferenceException
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Stack:
--------------------------------------------------------------------------------------------------------------------------------
bei Devart.Data.Linq.Provider.g.a(bg A_0)
bei Devart.Data.Linq.Provider.h.a(bg A_0)
bei Devart.Data.Linq.Provider.g.a(SqlExpression A_0)
bei Devart.Data.Linq.Provider.g.a(SqlExpression A_0, Boolean A_1)
bei Devart.Data.Linq.Provider.n.a(IDataServices A_0, SqlExpression A_1, Boolean A_2)
bei Devart.Data.Linq.Provider.n.a(IDataServices A_0, SqlExpression A_1)
bei Devart.Data.Linq.Provider.n.a(Type A_0, SqlExpression A_1, IDataServices A_2)
bei Devart.Data.Linq.Provider.DataProvider.CompiledQuery.GetReaderFactory(List`1 elementInstanceTypes, IDataServices services, SqlNode query)
bei Devart.Data.Linq.Provider.DataProvider.CompiledQuery..ctor(QueryInfo queryInfo, IDataServices services, Boolean isQueryObjectByKey, Object queryObjectKey)
bei Devart.Data.Linq.Provider.DataProvider.BuildQuery(Expression query)
bei Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Compile(Expression query)
bei Devart.Data.Linq.DataQuery`1.i()
bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
bei AxiCenter.QueryProvider.Misc.clsCustomerGroup.GetDropDownListCustomerGroup(String p_defaultEntry) Zeile 45.
It would be nice if you can point me to a solution.
Thank you!
Regards, Marco