简体   繁体   中英

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. If I switch back to Version 7.0.25 everything works fine.

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. But if I take the SQL-command it will result in 2 records.

If I change code in Line 2 to:

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. 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); 2) the exact data types of involved database columns; 3) are you using the OCI (via Oracle client) or Direct connection mode?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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