odp.net

How to disable connection pool?

牧云@^-^@ 提交于 2019-12-01 17:47:39
Connection string that my app is using to connect to DB is the following: private const string oradb = "Data Source=(DESCRIPTION=(ADDRESS_LIST=" + "(ADDRESS=(PROTOCOL=TCP)(HOST=host.name)(PORT=1521)))" + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=service.name)));" + "User Id=myusername;Password=mypass;"; In all DB access points of my app I am using the following pattern: OracleConnection conn = new OracleConnection(oradb); try { Console.WriteLine("Opening DB Connection..."); conn.Open(); string queryString = string.Format(@"SELECT ..."); using (OracleCommand command = new OracleCommand

Execute an oracle Function that returns a reference cursor in C#

强颜欢笑 提交于 2019-12-01 16:37:58
I have an oracle package with a procedure that has a in out reference cursor. My understanding is that this is pretty standard. What I didn't like is the fact that I had to write a ton of code to just see the output. So I asked this question and it turns out I can get what I want by creating a function that wraps the procedure. Update: Looks like I don't need the function anymore but it may be worth knowing anyway for those curious see the original question and answer updates. Here's the function FUNCTION GetQuestionsForPrint (user in varchar2) RETURN MYPACKAGE.refcur_question AS OUTPUT

“ORA-03135: connection lost contact” when inserting large file

纵然是瞬间 提交于 2019-12-01 16:05:31
问题 I'm trying to do an insert with a potentially large amount of binary data into a remote Oracle (11g) database using Entity Framework (ODP.Net). It works fine for really small files (<5 KB), but for larger ones (e.g. 44 KB) I get an error: "ORA-03135: connection lost contact". I don't think it's timing out, as the exception occurs within a second of executing the command. I tried setting both of the following in my connection string, but to no avail: Validate Connection=true Pooling=false I

Latest Oracle Data Provider for .NET (11.2.0.3.20) breaks EF Update Wizard

折月煮酒 提交于 2019-12-01 11:45:58
I have VS2012 and the latest 32-bit version of ODAC (Release 5 with Oracle Developer Tools) installed on a Win7 box. Everything is a clean install. In this environment, I have an ASP.NET Web Forms solution that was originally developed in VS2010 with EDMX files that were built on 32-bit ODAC Release 4. I am able to set up connections to the database and view tables using Server Explorer, but I am now unable to modify my EDMX files via the Update Wizard . No tables will show in the Update Wizard. Here is the connection string from the first step of the VS2012 Update Wizard: metadata=res://*

How to properly close ODP.net connection : dispose() or close()?

徘徊边缘 提交于 2019-12-01 11:19:40
this is my powershell code : [void][System.Reflection.Assembly]::LoadFile("C:\DLL\Oracle.ManagedDataAccess.dll") $OracleConnexion = New-Object Oracle.ManagedDataAccess.Client.OracleConnection('User Id=test;Password="test";Data Source=10.2.2.1/TEST') $TimeOut = 60 $OracleConnexion.Open() $Query=$OracleConnexion.CreateCommand() $Query.CommandText="Select * FROM TEST" $Query.CommandTimeout = $Timeout $ExecuteRequete=$Requete.ExecuteReader() while ($ExecuteRequete.Read()) { $SiebelLastRecord += $ExecuteRequete.GetDateTime(0).ToString() } $OracleConnexion.Close() So I'm opening ODP.NET connection

How to properly close ODP.net connection : dispose() or close()?

。_饼干妹妹 提交于 2019-12-01 08:25:53
问题 this is my powershell code : [void][System.Reflection.Assembly]::LoadFile("C:\DLL\Oracle.ManagedDataAccess.dll") $OracleConnexion = New-Object Oracle.ManagedDataAccess.Client.OracleConnection('User Id=test;Password="test";Data Source=10.2.2.1/TEST') $TimeOut = 60 $OracleConnexion.Open() $Query=$OracleConnexion.CreateCommand() $Query.CommandText="Select * FROM TEST" $Query.CommandTimeout = $Timeout $ExecuteRequete=$Requete.ExecuteReader() while ($ExecuteRequete.Read()) { $SiebelLastRecord +=

Latest Oracle Data Provider for .NET (11.2.0.3.20) breaks EF Update Wizard

别说谁变了你拦得住时间么 提交于 2019-12-01 08:22:42
问题 I have VS2012 and the latest 32-bit version of ODAC (Release 5 with Oracle Developer Tools) installed on a Win7 box. Everything is a clean install. In this environment, I have an ASP.NET Web Forms solution that was originally developed in VS2010 with EDMX files that were built on 32-bit ODAC Release 4. I am able to set up connections to the database and view tables using Server Explorer, but I am now unable to modify my EDMX files via the Update Wizard . No tables will show in the Update

Oracle Entity Framework - Call custom function (EDIT_DISTANCE)

自闭症网瘾萝莉.ら 提交于 2019-12-01 05:56:39
I am using Entity Framework 6 and Oracle Database 11g (ODP.NET Manage Driver). How to call UTL_MATCH.EDIT_DISTANCE function in LINQ query? There is an awesome Library to help with mapping Database functions and Stored Procedures to Entity Framework. Install the Nuget package - Install-Package EntityFramework.Functions Create Extension Methods for functions: public static class OracleFunctions { [Function(FunctionType.BuiltInFunction, "TO_NUMBER")] public static int? ToNumber(this string value) => Function.CallNotSupported<int?>(); } Map it on your EntityFramework Context: protected override

Is there a way to force OracleCommand.BindByName to be true by default for ODP.NET?

荒凉一梦 提交于 2019-12-01 04:52:23
Since the System.Data.OracleClient library has been deprecated , we are in the process of migrating our code base to use Oracle Data Provider for .NET (ODP.NET) instead. One of the issues that we have encountered is that the System.Data.OracleClient uses parameter name binding as opposed to binding by position and all of the code directly access the System.Data.OracleClient.OracleCommand as opposed to using an intermediate data layer. Since there is quite a bit of code, is there an easy way to force the ODP.NET OracleCommand.BindByName to be true by default, or must we go through and set the

Unable to find the requested .Net Framework Data Provider in Oracle

こ雲淡風輕ζ 提交于 2019-12-01 04:12:29
string constr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=spp01)(PORT=1521))(CONNECT_DATA=(SID=Global)));User Id=SYSMAN;Password=testman3"; string ProviderName = "Oracle.DataAccess.Client"; DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName); I am able to connect to oracle in console and winforms application. The code above is in a seperate class library. I have installed 64bit ODAC. The ORACLE.DATAACCESS is set to 2.x ver 2.112.3.0. I have checked machine.config entries Framework64 v2.0.50727 and v4.0.30319 type="Oracle.DataAccess.Client.OracleClientFactory,