日期:2014-05-17 浏览次数:20450 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Oracle.DataAccess.Client;
namespace OracleForNet
{
class Program
{
static void Main(string[] args)
{
string connstring = @"Data Source=192.168.8.9/ORCL;Persist Security Info=True;User ID=jrwx;Password=jrwx;Unicode=True";
OracleConnection conn=null;
try
{
conn = new OracleConnection(connstring);//“Oracle.DataAccess.Client.OracleConnection”的类型初始值设定项引发异常。
conn.Open();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
if(conn!=null)
conn.Close();
}
Console.Read();
}
}
}