Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试使用powershell打开oracle server的连接_Powershell - Fatal编程技术网

尝试使用powershell打开oracle server的连接

尝试使用powershell打开oracle server的连接,powershell,Powershell,我正在尝试打开与oracle server的连接,但出现以下错误 代码: $connectionString = "Data Source=$result;User ID=$userID;Password=$orapwd" $OracleConnection =New-Object System.Data.OracleClient.OracleConnection($connectionString) $OracleConnection.Open() write-host $

我正在尝试打开与oracle server的连接,但出现以下错误

代码:

$connectionString = "Data Source=$result;User ID=$userID;Password=$orapwd"
$OracleConnection =New-Object System.Data.OracleClient.OracleConnection($connectionString)
$OracleConnection.Open()
write-host $OracleConnection.state()
错误:

新对象:找不到类型[System.Data.OracleClient.OracleConnection]:请验证是否加载了包含此类型的程序集。
第18行字符:20
+ ... Connection=新对象System.Data.OracleClient.OracleConnection($con。。。
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+CategoryInfo:InvalidType:(:)[New Object],pArgumentException
+FullyQualifiedErrorId:TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
不能对空值表达式调用方法。
第22行字符:1
+$OracleConnection.Open()
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+CategoryInfo:InvalidOperation:(:)[],运行时异常
+FullyQualifiedErrorId:InvokeMethodOnFull
不能对空值表达式调用方法。
第23行字符:1
+写入主机$OracleConnection.state()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+CategoryInfo:InvalidOperation:(:)[],运行时异常
+FullyQualifiedErrorId:InvokeMethodOnFull
不能对空值表达式调用方法。
第24行字符:1
+$OracleConnection.Close()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+CategoryInfo:InvalidOperation:(:)[],运行时异常
+FullyQualifiedErrorId:InvokeMethodOnFull

您的问题与oracle数据库无关。错误显示没有类型
System.Data.OracleClient.OracleConnection
,是否确保导入了所有必需的内容?请尝试在脚本顶部添加
Add type-AssemblyName System.Data.OracleClient