Operation Steps:
1, DLL download and reference (this DLL is actually oracle for C # specifically provided, in its official can also download to the Oracle website)
: Oracle.ManagedDataAccess.zip
After downloading, place the Oracle.ManagedDataAccess.dll in your project and then reference
2. Call (connstring change to its own connection string)
Using Oracle.ManagedDataAccess.Client; public static string Connectoracle () { try { string connstring = "Data source= (description= (address= ( PROTOCOL=TCP) (host=130.147.246.144) (port=1521)) (Connect_data= (SERVICE_NAME=ECMS))); Persist Security info=true; User Id=system; password=service01; "; OracleConnection con = new OracleConnection (connstring); Con. Open (); return string. Empty; } catch (Exception ex) { return ex. ToString (); } }
Reference:
Http://www.cnblogs.com/yjmyzz/archive/2013/11/01/3400999.html
Http://www.cnblogs.com/ly303550688/archive/2013/01/31/2887104.html
C # Connect to Oracle Database (direct reference DLL usage)