0
votes

I have "table or view does not exist" exception when I send my sql request. How can I remove " "dbo". " from my sql request to make it work?

Exception :

ORA-00942: table or view does not exist

SQL:

SELECT 
 CAST( "Extent1"."COM_CHRONO" AS number(10,0)) AS "C1", 
"Extent1"."SER_CODE" AS "SER_CODE", 
"Extent1"."REP_NOM" AS "REP_NOM", 
"Extent1"."COM_COMMENTAIRE" AS "COM_COMMENTAIRE", 
FROM "dbo"."COMMANDE" "Extent1"

linq:

var sel = from c in ctx.Orders 
          select c;
1
Just remove "dbo.". You need to find out where COMMANDE table is created, if its in current schema, use COMMANDE directly, if it is in some other schema, use schema.table_name to access, but make sure that the current schema has appropriate grants on that table.San

1 Answers

0
votes

It is unclear whether you are using Code-First or Database-First approach.

If Code-First approach is your case, then you have to specify Schema for the Table attribute like this:

[Table("TableName", Schema="MySchema")]
public class SomeClassName {
    ...
}

If you're using the latter approach, then you have to change Database Schema Name property of your EntityModel (by default it is 'dbo'). Just select your EDMX file in 'Solution Explorer' and check it's properties.