Freigeben über


ConnectionSettings.ThrowIfPropertyNotSet-Methode (String, String)

Löst eine Ausnahme aus, wenn die angegebene Verbindungseigenschaft NULL oder leer ist.

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

Syntax

'Declaration
Protected Function ThrowIfPropertyNotSet ( _
    propertyName As String, _
    str As String _
) As String
'Usage
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

Parameter

  • propertyName
    Typ: String
    Eine Zeichenfolge, die den Namen der Verbindungseigenschaft angibt, z. B. "Login".
  • str
    Typ: String
    Ein String-Objekt, das den Eigenschaftswert enthält.

Rückgabewert

Typ: String
Wenn die Zeichenfolge NULL oder leer ist, löst diese Methode PropertyNotSetException aus.Andernfalls gibt diese Methode den Parameterwert str zurück.

Siehe auch

Verweis

ConnectionSettings Klasse

ThrowIfPropertyNotSet-Überladung

Microsoft.SqlServer.Management.Common-Namespace