ConnectionSettings.ThrowIfPropertyNotSet 메서드 (String, String, Boolean)

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

네임스페이스:  Microsoft.SqlServer.Management.Common
어셈블리:  Microsoft.SqlServer.ConnectionInfo(Microsoft.SqlServer.ConnectionInfo.dll)

구문

‘선언
Protected Function ThrowIfPropertyNotSet ( _
    propertyName As String, _
    str As String, _
    checkEmpty As Boolean _
) As String
‘사용 방법
Dim propertyName As String 
Dim str As String 
Dim checkEmpty As Boolean 
Dim returnValue As String 

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

매개 변수

  • propertyName
    유형: System.String
    A string that specifies the name of the connection property, such as "Login".
  • checkEmpty
    유형: System.Boolean
    True if you want to check the property value for an empty string or null value; false if you want to check only for a null value.

반환 값

유형: System.String
If the property is not set, this method throws a PropertyNotSetException. Otherwise, this method returns the str parameter value.

주의

If you want to throw the exception if the property value is an empty string, set the checkEmpty parameter to true.

참고 항목

참조

ConnectionSettings 클래스

ThrowIfPropertyNotSet 오버로드

Microsoft.SqlServer.Management.Common 네임스페이스