Compartilhar via


Método ConnectionSettings.ThrowIfPropertyNotSet (String, String)

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

Namespace:  Microsoft.SqlServer.Management.Common
Assembly:  Microsoft.SqlServer.ConnectionInfo (em Microsoft.SqlServer.ConnectionInfo.dll)

Sintaxe

'Declaração
Protected Function ThrowIfPropertyNotSet ( _
    propertyName As String, _
    str As String _
) As String
'Uso
Dim propertyName As String 
Dim str As String 
Dim returnValue As String 

returnValue = Me.ThrowIfPropertyNotSet(propertyName, _
    str)
protected string ThrowIfPropertyNotSet(
    string propertyName,
    string str
)
protected:
String^ ThrowIfPropertyNotSet(
    String^ propertyName, 
    String^ str
)
member ThrowIfPropertyNotSet : 
        propertyName:string * 
        str:string -> string
protected function ThrowIfPropertyNotSet(
    propertyName : String, 
    str : String
) : String

Parâmetros

  • propertyName
    Tipo: System.String
    A string that specifies the name of the connection property, such as "Login".

Valor de retorno

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

Consulte também

Referência

ConnectionSettings Classe

Sobrecarregado ThrowIfPropertyNotSet

Namespace Microsoft.SqlServer.Management.Common