I need a little help connecting to an oracle database. I keep getting this error: Data provider internal error(-3000) [System.String].

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

namespace OrcaleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "user id=travus;password=password;data source=127.0.0.1";
            
            OracleConnection connection = new OracleConnection();
            connection.ConnectionString = connectionString;
          
            connection.Open();

            connection.Close();

            Console.WriteLine("End of application...");
            Console.ReadKey();
        }
    }

First of all, distributed transactions are handled by Distributed Transaction Coordinator service, so, MS DTC service must be running (in major configuration it's start mode is Manual)

Second, behaviour of odp.net depends on exact version of Oracle server and client versions and .net framework version. Recipe shown here wasn't checked on all possible combinations.

Third, there are some special connection string parameters needs to be considered.

As follows from ORACLE, when first connection is opened to Oracle Database 10g (or higher), a local transaction is created. When a second connection is opened, the transaction is automatically promoted to a distributed transaction.

Connections, created from transaction context, must have "Promotable Transaction" setting set to "promotable".

Also, if application use System.Transactions, it is required that the "enlist" connection string attribute is set to either "true" (default) or "dynamic"

From what I've read this is a known issue that is resolved in 11.1

You can also try creating a UDL file to assist in creating a connection string that should work.

Right click your desktop and create a new text file. Rename that text file to Connection.udl. Double click this file to run it and test your database connection. Once you have all the settings the way you want, close the program. You can now open the UDL file in notepad and you have a proper connection string that should work for you.

Hope this helps.

This article has been dead for over six months. Start a new discussion instead.