Where is type [Oracle.DataAccess.Client.OracleBulkCopy]?

一曲冷凌霜 提交于 2019-12-12 04:17:55

问题


I tried

[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess") 
$bulkCopy = new-object Oracle.DataAccess.Client.OracleBulkCopy $oraClientConnString

and got

GAC    Version        Location                                                                                                                                                 
---    -------        --------                                                                                                                                                 
True   v2.0.50727     C:\Windows\assembly\GAC_32\Oracle.DataAccess\2.111.6.0__89b483f429c47342\Oracle.DataAccess.dll                                                           
New-Object : Cannot find type [Oracle.DataAccess.Client.OracleBulkCopy]: make sure the assembly containing this type is loaded.
At line:3 char:23
+ $bulkCopy = new-object <<<<  Oracle.DataAccess.Client.OracleBulkCopy $oraClientConnString
    + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentException
    + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand

Cf. OracleBulkCopy Class

What is missing?


回答1:


Maybe you're using an older version of Oracle? I see documentation for this class on Oracle for 11g or later.

http://download.oracle.com/docs/html/E10927_01/OracleBulkCopyClass.htm

Oracle.DataClient.dll is the containing assembly in the above documentation.

Try this:

ps> $a = [reflection.assembly]::loadwithpartialname("oracle.dataaccess")
ps> $a.getexportedtypes() | where { $_.fullname -like "*bulk*" }

-Oisin



来源:https://stackoverflow.com/questions/4912944/where-is-type-oracle-dataaccess-client-oraclebulkcopy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!