odp.net

Timeout for OracleDataReader.Read Method

浪子不回头ぞ 提交于 2019-11-28 12:10:41
The ODP.NET OracleCommand class has a CommandTimeout property that can be used to enforce a timeout for the execution of a command. This property seems to work in situations where the CommandText is a SQL statement. The example code is used to illustrate this property in action. In the initial version of the code, the CommandTimeout is set to zero - telling ODP.NET not to enforce a timeout. using System; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Linq; using System.Text; using Oracle.DataAccess.Client; namespace ConsoleApplication3 { class

ODP.NET Managed - Unable to find requested .Net Framework Data Provider

半城伤御伤魂 提交于 2019-11-28 12:09:15
Using Visual Studio 2013, I've added the latest version of ODP.NET Managed to a project using Nuget: Install-Package odp.net.managed http://www.nuget.org/packages/odp.net.managed/121.1.2 Now, when I try to run the following code: Database db = DatabaseFactory.CreateDatabase(); It throws the following exception: An exception of type 'System.ArgumentException' occurred in System.Data.dll but was not handled in user code Additional information: Unable to find the requested .Net Framework Data Provider. It may not be installed. After reading of other users's similar issues, I added the Managed

Oracle.DataAccess.Client Dependencies

こ雲淡風輕ζ 提交于 2019-11-28 10:13:11
First of all, I want to use the Oracle.DataAccess.dll to use OracleBulkCopy . I want to know all the dlls that I need to be able to read from a database and then perform a bulkcopy in Oracle. Currently, we are using only one dll to perform all the reads from databases, we are using Oracle.ManagedDataAccess.Client . But I can't use it to perform a bulkCopy. I don't want to install ODP.NET for the users, I want to include the dll directly in the program. So I want to know the minimum required dlls to be able to use the Oracle.DataAccess.dll in 32bit and in 64bit. I know that there are some old

Oracle ODP.Net and EF CodeFirst - SaveChanges Error

北慕城南 提交于 2019-11-28 10:01:29
问题 Could someone help me with this: The code: Role r = new Role { ID = 1, Name = "Members" }; ctx.Roles.Attach(r); //Saving User User u = new User { Login = login, Password = password, Status = 1 }; u.Roles.Add(r); ctx.Users.Add(u); ctx.SaveChanges(); What I'm trying to do is to save a new user with an existing role. User and Role classes have a many-to-many relationship mapped by fluent-api as follows: modelBuilder.Entity<User>() .HasMany(u => u.Roles) .WithMany(r => r.Users) .Map(x => { x

Binding query parameters by name with ODP.NET

人走茶凉 提交于 2019-11-28 09:46:45
I'm currently using the Microsoft ADO.NET provider for Oracle ( System.Data.OracleClient ). I'm aware that it is certainly not the best Oracle provider available and that it will soon be deprecated , I should be using Oracle's ODP.NET instead. The reason why I still use the MS provider is because ODP.NET binds parameters by position , not by name. This can really be a PITA when you use many parameters in a query, because you have to be careful to add them in the right order, which can easily lead to bugs. It's also annoying when you use the same parameter multiple times in the same query, for

How to install ODP.NET 2.111 and ODP.NET 4.112 in the same machine side-by-side while both point to the same database server

瘦欲@ 提交于 2019-11-28 06:51:43
问题 The question is how to install ODP.NET 2.111 and ODP.NET 4.112 in the same machine side-by-side while both point to the same database server using tnsnames.ora I need to support a legacy system based on Oracle 11.1.0. The system is using ODP.NET 2.111 to connect to oracle. There are two clients installed at: C:\oracle\product\11.1.0\client_1 C:\oracle\product\11.1.0\client_2 The tnsnames.ora for both is something like this: xxxx1_SERVICE= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =

ORA-03113: end-of-file on communication channel after long inactivity in ASP.Net app

只谈情不闲聊 提交于 2019-11-28 05:53:34
I've got a load-balanced (not using Session state) ASP.Net 2.0 app on IIS5 running back to a single Oracle 10g server, using version 10.1.0.301 of the ODAC/ODP.Net drivers. After a long period of inactivity (a few hours), the application, seemingly randomly, will throw an Oracle exception: Exception: ORA-03113: end-of-file on communication channel at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure) at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery,

Oracle ODP.Net and EF CodeFirst - edm.decimal error

拜拜、爱过 提交于 2019-11-28 04:50:22
问题 I have the following simple entity: public class Something{ [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public int ID { get; set; } public string NAME { get; set; } public int STATUS { get; set; } } As you can see, I do not want the ID is generated from the database but I'm going to enter manually. This my DbContext class: public class MyCEContext : DbContext { ... public DbSet<Something> Somethings { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) {

ODP.NET How to pass array of strings to an Oracle Stored procedure?

流过昼夜 提交于 2019-11-28 04:47:16
问题 There's numerous question and confusing docs on the subject, but no luck so far. I've the following PL/SQL stored procedure; PROCEDURE PS_test( Liste1 Listcar, Liste2 Listcar, P_CURS_MESSAGE out CURSOR_REF_TYP ) Where the type Listcar is the following: TYPE Listcar IS VARRAY(100) OF VARCHAR2(50); Here is what I'm trying so far: string[] list = { "name1", "name1" }; OracleParameter oParam = (OracleParameter)myOracleCommand.CreateParameter(); oParam.ParameterName = "Liste1"; oParam.UdtTypeName

Randomly getting ORA-08177 with only one active session

拟墨画扇 提交于 2019-11-28 02:32:34
问题 I'm running a program that creates a table and then inserts some data. This is the only program that accesses the database. I'm getting ORA-08177 randomly. Actual code is somewhat complex, but I've written a simple program that reproduces this behavior. using System; using System.Data; using Oracle.DataAccess.Client; namespace orabug { class Program { private const string ConnectionString = ""; // Valid connection string here // Recreates the table private static void Recreate() { using (var