Share via


Méthode ConnectionSettings.ThrowIfPropertyNotSet (String, String)

Lève une exception si la propriété de connexion spécifiée est vide ou a la valeur Null.

Espace de noms :  Microsoft.SqlServer.Management.Common
Assembly :  Microsoft.SqlServer.ConnectionInfo (en Microsoft.SqlServer.ConnectionInfo.dll)

Syntaxe

'Déclaration
Protected Function ThrowIfPropertyNotSet ( _
    propertyName As String, _
    str As String _
) As String
'Utilisation
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

Paramètres

  • propertyName
    Type : String
    Chaîne qui spécifie le nom de la propriété de connexion, par exemple « Connexion ».
  • str
    Type : String
    Objet String qui contient la valeur de propriété.

Valeur de retour

Type : String
Si la chaîne est vide ou a la valeur Null, cette méthode lève une PropertyNotSetException.Sinon, cette méthode retourne la valeur de paramètre str.

Voir aussi

Référence

ConnectionSettings Classe

Surcharge ThrowIfPropertyNotSet

Espace de noms Microsoft.SqlServer.Management.Common