OracleConnectionStringBuilder.TryGetValue(String, Object) 方法

定义

从此 OracleConnectionStringBuilder检索与提供的键对应的值。

public:
 override bool TryGetValue(System::String ^ keyword, [Runtime::InteropServices::Out] System::Object ^ % value);
public override bool TryGetValue(string keyword, out object value);
override this.TryGetValue : string * obj -> bool
Public Overrides Function TryGetValue (keyword As String, ByRef value As Object) As Boolean

参数

keyword
String

要检索的项的键。

value
Object

keyword. 对应的值。

返回

如果在 连接字符串 中找到 true,则为 keyword;否则为 false

注解

此方法 TryGetValue 可让开发人员安全地从某个 OracleConnectionStringBuilder 值检索值,而无需验证提供的密钥名称是否为有效的密钥名称。 由于 TryGetValue 正常处理搜索不存在的密钥,因此在检索密钥值之前无需查找密钥是否存在。 使用不存在的键调用 TryGetValue 会将值 null(Nothing in Visual Basic)置于 value 参数中。

适用于

另请参阅