oracle sid 连接字符串,C#连接字符串-具有IP地址,端口和sid的Oracle 10g连接

I want to connect my WPF application with Oracle database, currently I have tried following connection strings, but these are not working.

I have:

IP address: 172.16.9.18

Port: 1521

SID: SID10

User Id: Scott

Password: Tiger

I tried:

"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.9.18)(PORT=1521))(CONNECT_DATA=(SID=SID10)));User ID=Scott;password=Tiger;"; //Not working

"Data Source=172.16.9.18:1521/SID10;Persist Security Info=True;User ID=Scott;Password=Tiger;Unicode=True"; //Not working

Where am I going wrong?

Talk2:

No, above solution is taken from there.

Talk3:

Do you get an exception? What does it say?

Talk4:

Do you have/need oracle client software installed? See also stackoverflow.com/questions/3268260/…

Talk5:

Are you posting your credentials here?

Solutions1

Try out something like this:

public string GetConnString(string host,string port,string sid,string user,string pass)

{

return String.Format("SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={0})(PORT={1}))(CONNECT_DATA=(SID={2})));uid={3};pwd={4};", host, port, sid, user, pass);

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值