使用SSIS将Oracle数据库与C#连接 [英] connecting oracle database with C# using SSIS

查看:83
本文介绍了使用SSIS将Oracle数据库与C#连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个使用某些C#脚本的SSIS软件包.在此脚本中,我需要连接到ORACLE数据库.我使用了一个变量来存储连接字符串的值,但是我无法通过使用此变量的(连接字符串)值将脚本连接到Oracle数据库.相同的连接字符串在SSIS中有效,但我无法通过C#脚本使用此字符串进行连接.

这是我用来从变量获取连接字符串的代码示例

 字符串 connn = Dts.Variables [" ].Value.ToString();
           OleDbConnection oCon =  OleDbConnection(connn);




并将值存储在变量= Data Source=DEV.WORLD;User ID=GCAWARDSX; Password = gcawardsx;Provider=Microsoft OLE DB Provider for Oracle;Persist Security Info=True;

解决方案

中,尝试使用用于OLE DB的Oracle Provider"而不是用于Oracle的Microsoft OLE DB Provider".它解决了我.


我也遇到了相同的问题,错误代码为:ora-00911无效字符
请问我要解决这个问题


i am making a SSIS package which uses certain C# script. in this script i need to connect to ORACLE database. I have used a variable to store a value of connection string but i can''t connect my script to the Oracle Database by using the (connection string)value of this variable. The same connection string works in SSIS but i cant make connection using this string through my C# script.

heres the sample of code i used to get the connection string from the variable

string connn = Dts.Variables["OleDBConnString"].Value.ToString();
           OleDbConnection oCon = new OleDbConnection(connn);




and the value stored in the variable=Data Source=DEV.WORLD;User ID=GCAWARDSX; Password = gcawardsx;Provider=Microsoft OLE DB Provider for Oracle;Persist Security Info=True;

解决方案

Try using "Oracle Provider for OLE DB" rather than "Microsoft OLE DB Provider for Oracle". It solved me.


i have the same problem it give me error code: ora-00911 invalid character
please i want solution for this


这篇关于使用SSIS将Oracle数据库与C#连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆