Entity framwrok return no Data

Entity framwrok return no Data

Postby chamamo » Tue 10 Jul 2012 17:18

Hello
I am using DotConnect for Oracle with entity framwork and I have no Data when I execute my query, I have 0 rows every time, there is no exeption.

Code: Select all
var list = (from c in Context.Set<entity>()
                       where c.Id>0
                       select c.Id).ToList();


Generated query:

Code: Select all
SELECT
"Extent1"."Id"
FROM SHEMA."entity" "Extent1"
WHERE "Extent1"."Id" > 0


this query work fine with SQL Server
any Idea?


thak you in advance.
chamamo
 
Posts: 3
Joined: Tue 10 Jul 2012 16:33

Re: Entity framwrok return no Data

Postby Shalex » Fri 13 Jul 2012 10:54

This works in our environment.
chamamo wrote:
Code: Select all
SELECT
"Extent1"."Id"
FROM SHEMA."entity" "Extent1"
WHERE "Extent1"."Id" > 0

Try executing the query against your database using a plain ADO.NET (OracleCommand.ExecuteReader) or some database management tool (OraDeveloper Studio, SQL Developer, SQL Plus, etc). If the query itself returns result set but nothing is returned via Entity Framework, please send us a small test project with the corresponding DDL/DML script so that we can reproduce the issue in our environment.
Shalex
Devart Team
 
Posts: 7465
Joined: Thu 14 Aug 2008 12:44

Re: Entity framwrok return no Data

Postby chamamo » Fri 13 Jul 2012 13:30

I tried with OracleCommand and I had a result,

I found how to do, in Oracle I must do mapping with tables, fields and schema in uppercase

the generated qery is:

Code: Select all
SELECT
"Extent1"."ID"
FROM SHEMA."ENTITY" "Extent1"
WHERE "Extent1"."ID" > 0


and it work,

can devart transform the generated query in uppercase? there is an option in oracle to accept queries like this in lowercase?

thank you
chamamo
 
Posts: 3
Joined: Tue 10 Jul 2012 16:33

Re: Entity framwrok return no Data

Postby Shalex » Mon 16 Jul 2012 14:09

chamamo wrote:can devart transform the generated query in uppercase?

Upper case is a default case for Oracle. Try disabling quoting (add reference to the %ProgramFiles%\Devart\dotConnect\Oracle\Entity\EF4\Devart.Data.Oracle.Entity.dll assembly):
Code: Select all
    var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
    config.Workarounds.DisableQuoting = true;

So the result query will be like:
Code: Select all
SELECT
Extent1.Id
FROM SHEMA.entity Extent1
WHERE Extent1.Id > 0
Shalex
Devart Team
 
Posts: 7465
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle