Udostępnij za pośrednictwem


ConnectionSettings.ThrowIfPropertyNotSet Method (String, String)

Throws an exception if the specified connection property is null or empty.

Namespace: Microsoft.SqlServer.Management.Common
Assembly: Microsoft.SqlServer.ConnectionInfo (in microsoft.sqlserver.connectioninfo.dll)

Syntax

'Deklaracja
Protected Function ThrowIfPropertyNotSet ( _
    propertyName As String, _
    str As String _
) As String
protected string ThrowIfPropertyNotSet (
    string propertyName,
    string str
)
protected:
String^ ThrowIfPropertyNotSet (
    String^ propertyName, 
    String^ str
)
protected String ThrowIfPropertyNotSet (
    String propertyName, 
    String str
)
protected function ThrowIfPropertyNotSet (
    propertyName : String, 
    str : String
) : String

Parameters

  • propertyName
    A string that specifies the name of the connection property, such as "Login".
  • str
    A String object that contains the property value.

Return Value

If the string is null or empty, this method throws a PropertyNotSetException. Otherwise, this method returns the str parameter value.

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.