[code=csharp] 测试例子[/code]
public void connByOracleClient() { string connString = @"user id=XXXXpassword=XXXX;Data Source=(DESCRIPTION =" + "(ADDRESS = (PROTOCOL = TCP)(HOST = XX.xx.xx.xx)(PORT = 1521))" + " (CONNECT_DATA =" + " (SERVER = DEDICATED)" + " (SERVICE_NAME = xx)" + "))"; OracleConnection conn = new OracleConnection(connString); conn.Open(); string sql = "select * from xx"; OracleCommand comm = new OracleCommand(sql, conn); OracleDataReader rdr = comm.ExecuteReader(); while (rdr.Read()) { string s = rdr.GetString(5); }
关于vs2008使用oracleclient链接oracle数据库报报错OCIEnvCreate 失败,返回代码为 -1,但错误消息文本不可用
原文地址:http://blog.csdn.net/wangshuai6707/article/details/44788569