远程连接的连接字符串可以这样写
oledbconnection 的连接字符串:
provider=msdaora;host=192.168.1.1;data source=mytest;user id=system;password=xxx
provider = msdaora; 指明oledb 的提供者是oracle数据库
host 是远程 oracle 数据库所在服务器的ip地址,如果端口不是默认的 1521,还要加上一个 port=xxxx;
data source 是要访问的 oracle 数据库的名字
user id 和 password 就不说了。
.net managed provider for oracle 的连接字符串:
server=192.168.1.1;data source=mytest;user id=system;password=xxx
要能够成功运行上面代码,我们必须在代码运行的机器上安装 oracle 的客户端,否则会报
the oracle(tm) client and networking components were not found 这个错误。