ConnectionSettings.ThrowIfPropertyNotSet 方法 (String, String)

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

命名空间:  Microsoft.SqlServer.Management.Common
程序集:  Microsoft.SqlServer.ConnectionInfo(在 Microsoft.SqlServer.ConnectionInfo.dll 中)

语法

声明
Protected Function ThrowIfPropertyNotSet ( _
    propertyName As String, _
    str As String _
) As String
用法
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

参数

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

返回值

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

请参阅

参考

ConnectionSettings 类

ThrowIfPropertyNotSet 重载

Microsoft.SqlServer.Management.Common 命名空间