Test you ODP.NET connection with following program

using System;
using Oracle.DataAccess.Client;

namespace NoOraClient
{
    class Program
    {
        static void Main(string[] args)
        {
            //You need to enter a valid Oracle connection string, below is the format
            string connectionString = "user id=USERID;password=PASSWORD;" +
                "data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=IPorSERVERNAME)" +
                "(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ValidSID)))";

            using (OracleConnection connection = new OracleConnection())
            {
                connection.ConnectionString = connectionString;

                try
                {
                    connection.Open();
                    Console.WriteLine("Connection Successful!");
                    Console.ReadLine();  // stops the console from closing until you hit the ENTER key
                }
                catch (OracleException ex)
                {
                    Console.WriteLine(ex.ToString());
                    Console.ReadLine();  // stops the console from closing until you hit the ENTER key
                }
            }           
        }
    }
}

Comments

Popular posts from this blog

Add Serial no in crystal report without coding

File operations in C# (.net)

SQL – Generate decimal numbers sequence for particular number range