Click here to Skip to main content
15,943,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have achieved to connect to remote oracle DB without installing oracle client(Using Oracle Instant client Instant Oracle Using C#[^]). However this is working in my local development environment, where I do not have any client installed.

The problem I am facing is, if I copy the same Exe to server and run, it throws an exception "System.Data.OracleClient requires Oracle client software version 8.1.7 or greater".

C#
using System;
using System.Data;
using System.Windows.Forms;
using System.Data.OracleClient;

namespace PartialUpdateReport
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
           
           string strConn = "User Id=liverw;Password=fa2aU7Vu7;Data Source=(DESCRIPTION=" +
                            "(ADDRESS=(PROTOCOL=TCP)(HOST=ukdbt9Ltadb01.dotcom.org)(PORT=1521))" +
                            "(CONNECT_DATA=(SID=DBT9LTF)));";
           OracleConnection conn = new OracleConnection();
           //OdbcConnection conn = new OdbcConnection();
           conn.ConnectionString = strConn;
           conn.Open();
           OracleCommand cmd = new OracleCommand();
           cmd.Connection = conn;
           cmd.CommandText = "Select * from liverw.tbl_change_log";
           cmd.CommandType = CommandType.Text;

           OracleDataAdapter da = new OracleDataAdapter(cmd);
           DataSet ds = new DataSet();
           da.Fill(ds);
           conn.Close();

           MessageBox.Show(ds.Tables[0].Rows[0][1].ToString());

           
        }
    }
}


Server COnfiguration:
Windows server 2003 R2(Service Pack 2)
64 Bit, 4 GB Ram
AMD Processor.

NOte: I cannot install oracle client on server, so this solution is ruled out.

Can anyone please help me in making it work in server

Thanks for the support
Posted

1 solution

I have resolved it, I used lower version of Instant Oracle Client(10).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900