Page 1 of 1

Errors in obtaining data by dotConect for Oracle 9.13

Posted: Wed 30 Sep 2020 09:01
by dqrest
Hello!

I have the following tools in my computer:
1) Oracle Client 12.2.0 x64
2) dotConect for Oracle 9.13 (trial version)
3) MS VS 2019

Now I create a concole application for .NetFramework 4.7.2 in MS VS 2019.
Than I compile this application as x64 with the following code.

Code: Select all

[Table(Name = "OBJ$GROUPS")]
    public class Group
    {
        long _No;
        [Column(Name = "NO", Storage = "_No", IsPrimaryKey = true)]
        public long No { get { return _No; } }
    }

Code: Select all

public class Result
    {
        public long No { get; set; }
        public long? TypeNo { get; set; }

    }

Code: Select all

[ProviderAttribute(typeof(Devart.Data.Oracle.Linq.Provider.OracleDataProvider))]
    public class TypeTreeDataContext : DataContext
    {
        public TypeTreeDataContext(OracleConnection conn) : base(conn) { ObjectTrackingEnabled = false; }

        public Table<Group> Group => GetTable<Group>();

    }

Code: Select all

static void Main(string[] args)
{
     OracleConnection conn = new OracleConnection("Pooling=false") { UserId = Login, Password = Password, Server = 					 
                                                                                                                       Server, Direct = false };
     conn.Open();
     
      var data = new TypeTreeDataContext(conn);

            var res= data.Group
                .Where(g => g.No >= 1000000 && g.No <= 1050000)
                .Select(g => new Result{
                    No = g.No,
                    TypeNo = 10                     
                })
                .ToList();
 }
After launching the application I have an error in the row of executing the query.
The error have the following message:
"Конструктор для типа "System.Runtime.CompilerServices.StrongBox`1[[System.Nullable`1[[System.Int64, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]" не найден"

What happend? This problem is not appeared in dotConnect 6.60.258 (but for x86).
Note that the problem is solved after removing TypeNo in the result and the application should be compiled by x64.

Re: Errors in obtaining data by dotConect for Oracle 9.13

Posted: Thu 01 Oct 2020 04:59
by dqrest
Is there any solution of this problem?

Re: Errors in obtaining data by dotConect for Oracle 9.13

Posted: Thu 01 Oct 2020 08:50
by dqrest
After making some experiments I have found the following ugly solution
var res= data.Group
.Where(g => g.No >= 1000000 && g.No <= 1050000)
.Select(g => new Result{
No = g.No,
TypeNo = new long?(10)
})
.ToList()

Re: Errors in obtaining data by dotConect for Oracle 9.13

Posted: Mon 05 Oct 2020 16:20
by Shalex
Thank you for your report. We will investigate the issue and notify you about the result.

Re: Errors in obtaining data by dotConect for Oracle 9.13

Posted: Fri 30 Oct 2020 11:12
by Shalex
The bug with using nullable numeric types within subqueries is fixed: viewtopic.php?f=31&t=42366.