OCIEnvNlsCreate 失败,返回代码为 -1,但错误消息文本不可用。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Exception: OCIEnvNlsCreate 失败,返回代码为 -1,但错误消息文本不可用。这个问题怎么解决?
刚接触oracle就碰到了这样让人摸不着头脑的问题.怎么办.

解决方案 »

  1.   

    安装 Oracle client for .NET了吗?
      

  2.   

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=212065&SiteID=1
    按这里的说法,这个应该是Windows XP and Windows 2003中,asp.net的工作进程(aspnet_isapi.dll ?)需要有读写oralce文件夹的权限。Reference:Just chiming in to confirm that this error is always a permissions problem, in my experience. I've only seen it happen when permissions fail, or the managed provider fails to find a file it needs (not necessarily due to permissions, but some other installation problem).If it can't find *any* Oracle files, usually you will get a different error, the one that says you need to have Oracle 8.1.7 or higher installed. This error means it found enough to get started, but the OCI layer than failed to find a required file. This is probably because the initial OCI DLL is in a accessible location, but subsequent files are somewhere else.FileMon (as already mentioned in this thread) and possibly RegMon can be good ways to track this down, particularly for permissions problems. You can get both tools at http://www.sysinternals.com.Thanks,
    Sarah
      

  3.   

    我用的是windows server 2003 sp2的,我在网上搜索到有人说是权限问题.
    我把所有用户都改成了完全控制权限了.还是不行.至于你说的安装oracle client for.net我想是不用安装的.我用.net2005提供的 system.data.oracleclient.dll组件.应该就不用装了吧.以前都是可以的.不过这次我有点摸不着头脑了.