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版本无关,应该都可以!