Compartir a través de


ConnectionSettings.ThrowIfPropertyNotSet Método (String, String)

Inicia una excepción si la propiedad de conexión especificada es NULL o está vacía.

Espacio de nombres:  Microsoft.SqlServer.Management.Common
Ensamblado:  Microsoft.SqlServer.ConnectionInfo (en Microsoft.SqlServer.ConnectionInfo.dll)

Sintaxis

'Declaración
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: String
    Cadena que especifica el nombre de la propiedad de conexión, como por ejemplo, "Login".
  • str
    Tipo: String
    Objeto String que contiene el valor de la propiedad.

Valor devuelto

Tipo: String
Si la cadena es NULL o está vacía, este método inicia una clase PropertyNotSetException.En caso contrario, este método devuelve el valor de parámetro str.

Vea también

Referencia

ConnectionSettings Clase

Sobrecarga de ThrowIfPropertyNotSet

Espacio de nombres Microsoft.SqlServer.Management.Common