Database Connectivity with oracle database using c# -
while trying connect oracle database getting following error
"a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)"} problem may silly 1 first time database need help:
my code is:
static void main(string[] args) { using (sqlconnection conn = new sqlconnection()) { conn.connectionstring = "data source=orcl_boa; database=boanewdoc;user id=boanewdoc;password=boanewdoc;trusted_connection=true"; conn.open(); //code }
you may need reference oracle.manageddataaccess.dll on odtwithodac121012.zip can download oracle site. not use system.data.oracleclient obsolete.
var connection = new oracleconnection(yourconnectionstring); try { connection.open(); //amk: stuff db } catch (exception exception) { //amk: other stuff in case of error } { if(connection !=null && connection.state==connectionstate.open) connection.close(); }
Comments
Post a Comment