我用odbc连接,在odbc数据源中建立了一个名为YYMIS的数据源。
在asp.net(c#)中用如下方法连接:
/*****************************************************
OdbcConnection objConn = new OdbcConnection();
objConn.ConnectionString = "DRIVER={Oracle ODBC Driver};UID=www;PWD=asd;DBQ=YYMIS.world;DBA=W;";
objConn.Open();
******************************************************/
当单步执行到objconn.open()时,出现如下错误:
/*****************************************************
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
******************************************************/
我将objConn.ConnectionString改为: 
objConn.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=YYMIS.world;Uid=www;Pwd=asd";
或者objConn.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=YYMIS;Uid=www;Pwd=asd";
也同样出错。谁知道原因吗?我已经郁闷了一个下午了,试了网上的很多方法都不行。
高分求助!!!!!!

解决方案 »

  1.   

    找到oracle安装目录的network/admin目录,查看tnsnames.ora文件中有没有配置“YYMIS”服务器
      

  2.   

    http://search.csdn.net/Expert/topic/2565/2565017.xml?temp=.7721979
      

  3.   

    .NET中各种数据库连接大全http://www.csdn.net/Develop/read_article.asp?id=16437
      

  4.   

    http://search.csdn.net/expert/topicview1.asp?id=2450825
      

  5.   

    数据量很大吗,怎么不用sql?
      

  6.   

    http://www.topying.com/showfine.asp?id=36
      

  7.   

    在oracle的目录加上iis的访问权限
    \oracle\ora92\bin
      

  8.   

    数据源名没找到 客户端是否装了 ora9.2
      

  9.   

    sorry  错了
    数据源名没找到 服务器 是否装了 ora9.2