First install the Oracle client 1. Choose Control Panel> Administrative Tools> data source (ODBC)> add data source> select Oracle client data source name, we recommend that you use the same description as Sid to describe TNS service name. The tnsnames in the environment variable tns_admin directory is automatically displayed in the drop-down menu. name of SERVICE_NAME in the ora file, that is, the SID userid username to connect 2. Code string connectionstring = "Data Source = orcl; user id = Scott; Password = Scott "; // connection string oracleconnection conn = new oracleconnection (connectionstring); // create a new connection try {Conn. open (); // open the connection oraclecommand cmd = Conn. createcommand (); cmd. commandtext = "select * from EMP"; // SQL statement oracledatareader rs = cmd. executereader (); While (RS. read () // read data if RS. if the returned value of read () is false, {MessageBox. show (RS. getstring (1);} Rs. close ();} catch (exception e) {MessageBox. show (E. message);} finally {Conn. close ();}