wpf - C# connection string - Oracle 10g connectivity with IP address, port and sid -


i want connect wpf application oracle database, have tried following connection strings, these 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 going wrong?

try out 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); } 

Comments