标签:
1,添加引用
System.Data.OracleClient
2,连接语句
string connectionString;
string queryString;
connectionString = "Data Source=127.0.0.1/orcl;User ID=scott;PassWord=TIGER";
queryString = "SELECT * FROM TEST";
OracleConnection myConnection = new OracleConnection(connectionString);
OracleCommand myORACCommand = myConnection.CreateCommand();
myORACCommand.CommandText = queryString;
myConnection.Open();
OracleDataReader myDataReader = myORACCommand.ExecuteReader();
myDataReader.Read();
Response.Write("email: " + myDataReader["ID"]);
myDataReader.Close();
myConnection.Close();
测试通过!
感觉与vs和oracle版本无关,应该都可以!
vs2015连接oracle 11g(.net自带方式 using System.Data.OracleClient;)
标签:
原文地址:http://www.cnblogs.com/jianghaidong/p/5343391.html