无需安装客户端即可连接到oracle DB [英] Connecting to oracle DB without installing client
问题描述
大家好,
我已经实现连接到远程oracle DB而无需安装oracle客户端(使用Oracle Instant Client 即时Oracle使用C# [ ^ ])。然而,这在我的本地开发环境中工作,我没有安装任何客户端。
我面临的问题是,如果我将相同的Exe复制到服务器并运行,它会抛出异常System.Data.OracleClient需要Oracle客户端软件版本8.1.7或更高版本。
使用系统;
使用 System.Data;
使用 System.Windows.Forms;
使用 System.Data.OracleClient;
命名空间 PartialUpdateReport
{
public partial class Form1:Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click( object <> span sender,EventArgs e)
{
string strConn = 用户ID = liverw;密码= fa2aU7Vu7;数据源=(DESCRIPTION = +
(ADDRESS =(PROTOCOL = TCP)(HOST = ukdbt9Ltadb01.dotcom.org)(PORT = 1521)) +
(CONNECT_DATA =(SID = DBT9LTF)));;
OracleConnection conn = new OracleConnection();
// OdbcConnection conn = new OdbcConnection();
conn.ConnectionString =创建失败;
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = 选择* 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 ]。行[ 0 ] [ 1 ]。ToString());
}
}
}
服务器配置:
Windows服务器2003 R2(Service Pack 2)
64位,4 GB Ram
AMD处理器。
NOte:我无法在服务器上安装oracle客户端,因此排除了这个解决方案。
任何人都可以帮助我让它工作服务器
感谢支持
我已经解决了它,我使用了较低版本的Instant Oracle客户端(10)。
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".
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
I have resolved it, I used lower version of Instant Oracle Client(10).
这篇关于无需安装客户端即可连接到oracle DB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!