用VS2005,ORACLE版本是10g。以前用的一直很正常,今天调试程序的时候,报异常说:“System.Data.OracleClient需要Oracle客户端软件8.1.7或更高版本”。查了一下网上,按网上的方法把ORACLE HOME的Authenticate用户读写权限打开并应用到子目录,重启计算机后还是不管用。。请问应该如何解决?

解决方案 »

  1.   

    顺便说下,我试过ACCESS和SQLSERVER数据库都没有问题,只有ORACLE会报这样的异常。。到底是什么原因引起的啊
      

  2.   

    最好就是重装一个高级版本的oracle了
      

  3.   

    我们单位统一用10g版本
    ORACLE10g不算是太旧的版本吧?就算是9i也不算是特别旧吧。。
    以前我用10g从来没有出现过任何问题。。网上说是因为ORACLE目录的权限.NET访问不到造成的,但是按它的方法改了也不管用。。
    很纳闷,什么都没动怎么突然就成这样了。。
    以后开发的时候经常要用到ORACLE数据库,怎么办啊。。
      

  4.   

    我以前也遇到过老大说是Oracle连接模式的问题,Oracle有两种连接模式,一种是直连模式,不需要安装Oracle客户端的那种。。另一种模式忘记了
    <connectionStrings>
    <add name="conString" connectionString="data source=ip地址/数据库实例名;user=用户名;password=密码;"/>
    </connectionStrings>
    上面是我的连接字符串可以参考一下。。其他的和使用ms sql server的连接方式都差不多
      

  5.   

    lz用iis连的oracle吧,把bin目录赋予asp.net和iwan_xxx的读写权限再重启电脑看看。再不行重装一下客户端。
      

  6.   

    重新配置  Oracle在VS的 环境
      

  7.   

    TO#4 连接字符串应该没有问题的
    TO#5 没有自己安装IIS,是.NET内置的IIS,请问该怎么设置呢?
    TO#6 请问可以具体说一下吗?谢谢
      

  8.   

    自己试着又新建了一个项目,结果发现能连上ORACLE。看来不是ORACLE,也不是.NET的问题,也许是代码的问题。。我把我的代码发上来,大家帮忙看看。    public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private void Form1_Load(object sender, EventArgs e)
            {            DataSet ds = new DataSet();
                string sqlStr = "select * from emp";            //ORACLE连接
                IDbConnection myConn = connHelper.CreateConnection(DataBaseType.Oracle);
                IDbCommand myCmd = connHelper.CreateCommand(sqlStr, DataBaseType.Oracle, myConn);
                IDbDataAdapter myDa = connHelper.CreateDataAdapter(myCmd, DataBaseType.Oracle);            //ACCESS连接
                //IDbConnection myConn = connHelper.CreateConnection(DataBaseType.Access);
                //IDbCommand myCmd = connHelper.CreateCommand(sqlStr, DataBaseType.Access, myConn);
                //IDbDataAdapter myDa = connHelper.CreateDataAdapter(myCmd, DataBaseType.Access);            //SQLSERVER连接
                //IDbConnection myConn = connHelper.CreateConnection(DataBaseType.SqlServer);
                //IDbCommand myCmd = connHelper.CreateCommand(sqlStr, DataBaseType.SqlServer, myConn);
                //IDbDataAdapter myDa = connHelper.CreateDataAdapter(myCmd, DataBaseType.SqlServer);
                 myDa.Fill(ds);
                 DataTable dt = ds.Tables[0];
                 gridControl1.DataSource = dt;
                
            }
        }
            public enum DataBaseType
            {
                SqlServer,
                Access,
                Oracle
            }        public enum ParameterType
            {
                Integer,
                Char,
                VarChar
            }        public class connHelper
            {            public static IDbConnection CreateConnection(DataBaseType dbType)
                {
                    IDbConnection con;
                    switch (dbType)
                    {
                        case DataBaseType.Access:
                            con = new OleDbConnection(ConfigurationManager.ConnectionStrings["AccessConn"].ConnectionString);
                            break;
                        case DataBaseType.Oracle:
                            con = new OracleConnection(ConfigurationManager.ConnectionStrings["OracleConn"].ConnectionString);
                            break;
                        default:
                            con = new SqlConnection(ConfigurationManager.ConnectionStrings["SqlConn"].ConnectionString);
                            break;
                    }
                    return con;
                }            public static IDbCommand CreateCommand(string QueryString, DataBaseType dbType, IDbConnection con)
                {
                    IDbCommand cmd;
                    switch (dbType)
                    {
                        case DataBaseType.Access:
                            cmd = new OleDbCommand(QueryString, (OleDbConnection)con);
                            break;
                        case DataBaseType.Oracle:
                            cmd = new OracleCommand(QueryString, (OracleConnection)con);
                            break;
                        default:
                            cmd = new SqlCommand(QueryString, (SqlConnection)con);
                            break;
                    }
                    return cmd;
                }            public static IDbDataAdapter CreateDataAdapter(IDbCommand cmd, DataBaseType dbType)
                {
                    IDbDataAdapter ida;
                    switch (dbType)
                    {
                        case DataBaseType.Access:
                            ida = new OleDbDataAdapter((OleDbCommand)cmd);
                            break;
                        case DataBaseType.Oracle:
                            ida = new OracleDataAdapter((OracleCommand)cmd);
                            break; 
                        default:
                            ida = new SqlDataAdapter((SqlCommand)cmd);
                            break;
                    }
                    return ida;
                }
            }用此程序连接ACCESS和SQLSERVER均正常,但是ORACLE就不行。。请达人帮忙分析,谢谢啦!!
      

  9.   

    昨天下午去了单位,神奇般的正常了真搞不明白,是.NET的BUG么。。
    谢谢各位啦