TryGetValue method

Retrieves a value corresponding to the supplied key from this ULConnectionStringBuilder.

Syntax
Visual Basic
Public Overrides Function TryGetValue( _
   ByVal keyword As String, _
   ByVal value As Object _
) As Boolean
C#
public override bool TryGetValue(
   string  keyword,
   object value
);
Parameters
  • keyword   The key of the item to retrieve.

  • value   The value corresponding to the key.

Return value

True if keyword was found within the connection string, false otherwise.

Remarks

The TryGetValue method lets developers safely retrieve a value from a ULConnectionStringBuilder without needing to first call the ContainsKey method. Because TryGetValue does not raise an exception when you call it, passing in a nonexistent key, you do not have to look for a key before retrieving its value. Calling TryGetValue with a nonexistent key will place the null value (Nothing in Visual Basic) in the value parameter.

See also