我自己写的应用程序,需要连接服务器的oracle;
我本机PLSQL能正常连接,但是应用程序连接时报错;
下面我贴上连接代码 和oracle包
//app
<add name="oracle2" providerName="System.Data.OracleClient" connectionString="Persist Security Info=True;User ID=sklerpdb;Password=sklerpdb;Unicode=True;Data Source= (DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.105)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)));"/>
//后台
string oraclePath = System.Windows.Forms.Application.StartupPath + @"\oracle";
Environment.SetEnvironmentVariable("PATH", oraclePath, EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("NLS_LANG", "SIMPLIFIED CHINESE_CHINA.ZHS16GBK", EnvironmentVariableTarget.Process);
//包