Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
258 Points
84 Posts
May 02, 2012 07:37 AM|LINK
hi
if you are using oracle instant client , you dont have oracle connection configuration files available. you have to use the entire tnsnames block on your connection string.
try
using system.data.oracleclient; oracleconnection a = new oracleconnection(); a.connectionstring = "User ID=" + /*your_oracle_user*/ + ";Password=" + /*your_oracle_password*/ + ";Data Source=" + "(DESCRIPTION = " + " (ADDRESS = (PROTOCOL = TCP)(HOST = " + /*Your_host_name_or_ipaddress*/ + ")(PORT = 1521)) " + " (CONNECT_DATA = " + " (SERVER = DEDICATED) " + " (SID = " + /*Your_Sid_NAME*/ + ") " + " ) " + ")"; a.open();
ruipedromach...
Member
258 Points
84 Posts
Re: Connect To DataBase;
May 02, 2012 07:37 AM|LINK
hi
if you are using oracle instant client , you dont have oracle connection configuration files available.
you have to use the entire tnsnames block on your connection string.
try
using system.data.oracleclient; oracleconnection a = new oracleconnection(); a.connectionstring = "User ID=" + /*your_oracle_user*/ + ";Password=" + /*your_oracle_password*/ + ";Data Source=" + "(DESCRIPTION = " + " (ADDRESS = (PROTOCOL = TCP)(HOST = " + /*Your_host_name_or_ipaddress*/ + ")(PORT = 1521)) " + " (CONNECT_DATA = " + " (SERVER = DEDICATED) " + " (SID = " + /*Your_Sid_NAME*/ + ") " + " ) " + ")"; a.open();