简体   繁体   English

DevArt dotConnect for Oracle在EF 4.0字符串上具有奇怪的行为

[英]DevArt dotConnect for Oracle with strange behavior on strings with EF 4.0

After I updated my project to Version 7.2.114 of DevArt I recognized that some queries will not return results although the generated SQL is returning results if executed directly in TOAD. 在将项目更新为DevArt的7.2.114版后,我意识到尽管直接在TOAD中执行生成的SQL会返回结果,但有些查询将不会返回结果。 If I switch back to Version 7.0.25 everything works fine. 如果我切换回7.0.25版,一切正常。

My database Customer-table looks like this: 我的数据库客户表如下所示:

SomeField  | Firstname  | CustomerNo

(null)     | John       | 12345
12345      | John       | 12345
828282     | Mark       | 12346

My query looks like this: 我的查询如下所示:

var firstNameToSearch = "John";
var someFieldToSearch = null;
var result = from customer in context.Customers
            join someTable in context.SomeTables on customer.CustomerNo equals "12345"                            
            where someTable.SomeCondition && (someTable.SomeField == someFieldToSearch || someFieldToSearch == null) && (customer.Firstname == firstNameToSearch || firstNameToSearch == null) 

Now, when I execute the EF-query it will result in 0 records with no exception at all. 现在,当我执行EF查询时,它将导致0条记录,而没有任何异常。 But if I take the SQL-command it will result in 2 records. 但是,如果我使用SQL命令,它将导致2条记录。

If I change code in Line 2 to: 如果我将第2行中的代码更改为:

var someFieldToSearch = string.Empty;

it will return the right result. 它将返回正确的结果。

I found an some hints pointing to this code: 我发现了一些指向此代码的提示:

Devart.Data.Oracle.Entity.OracleEntityProviderServices.HandleNullStringsAsEmptyStrings = true;

but it has no effects. 但没有效果。

Please try the latest (7.2.122) version of dotConnect for Oracle. 请尝试使用最新版本(7.2.122)的dotConnect for Oracle。 If this doesn't help, specify the following information: 1) turn on the dbMonitor tool and post here (or at forums.devart.com/viewforum.php?f=30 ) the generated SQL, used parameters (their types and values); 如果这样做没有帮助,请指定以下信息:1)打开dbMonitor工具,并在此处(或在forums.devart.com/viewforum.php?f=30上 )发布生成的SQL,使用的参数(其类型和值) ); 2) the exact data types of involved database columns; 2)涉及的数据库列的确切数据类型; 3) are you using the OCI (via Oracle client) or Direct connection mode? 3)您使用的是OCI(通过Oracle客户端)还是直接连接模式?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM