1.安装ORACLE客户端9,修改C:\Oracle\ora90\network\ADMIN下的tnsnames.ora文件为:
# TNSNAMES.ORA Network Configuration File: C:\oracle\ora90\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
dpas =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.70)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
2.在web.config中加入:
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=dpas;User ID=dpas;Password=dpas;Unicode=True" providerName="System.Data.OracleClient"/>
</connectionStrings>