odbc是微软标准,jdbc是sun标准,配置数据源的好处是中间的配置层给数据库连接更多的灵活性,
坏处是多了一层,系统变复杂了,连接字符串好处是简单,坏处是写死了。

解决方案 »

  1.   

    how VS connect to Oracl9i 
     
    1.install oracle client
    install oracle client
    -->select not any components, only which can not be eliminated
    -->oracle net configuration assistant
    -->selected naming:local(only)
    -->corresponding version
    -->servicename(same as above)
    -->TCP
    -->hostname and port1521
    -->netservicename (any name you like), such as zmoracleonzmvm
     
    2.sqldatasource control
    -->config data source
    -->new connection
    -->change button: Oracle database
    -->server name: zmoracleonzmvm   (neither database name nor server name, but the name you specified as above)
    -->username, password
    -->test connection, congratulation!
    (during this step, if you have troubl connecting to the database and encountering 乱码, press the 'advanced' button, set the 'unicode'=false, then try again, you will see the normal error_information. 
    referrence to the following bold part)
     
    the following is my connectionstring in the web.config
    ...
     <connectionStrings>
      <add name="ConnectionString" connectionString="Data Source=zmoracleonzmvm;Persist Security Info=True;User ID=scott;Password=tiger;Unicode=True"
       providerName="System.Data.OracleClient" />
     </connectionStrings>
    ....