I created applications, first with ODP.Net and without Entity - it works fine.
static void Main(string[] args) { OracleConnection con = new OracleConnection(); //using connection string attributes to connect to Oracle Database con.ConnectionString = "user id=****;password=****;data source=" + "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server.org.net)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SERVICE_NAME=ora1)))"; con.Open(); Console.WriteLine("Connected to Oracle" + con.ServerVersion); OracleCommand command = con.CreateCommand(); command.CommandText = "SELECT ITEM FROM TEST.ORDERS"; OracleDataReader reader = command.ExecuteReader(); while (reader.Read()) { Console.WriteLine("\t{0}", reader[0]); } reader.Close(); // Close and Dispose OracleConnection object con.Close(); con.Dispose(); Console.WriteLine("Disconnected"); Console.ReadKey(); }
TEST.ORDERS is a view.
The second program uses ODP.Net and EntityFramework, and manaly created the DbSet class (which was tested on Npgsql.EntityFramework and works fine, a great copy of the view from Oracle). The application returns an error: ORA-00955. I noticed that when changing the name of the "Schema" to one that does not have "ORDER", the program creates my table with the same name. This is my DbSet start:
[Table("ORDERS", Schema = "TEST")]
This may be wrong. But I do not know how to create objects that will have access to this view. The user has permission only for SELECT. I want to perform read-only operations.
source share