ConnectionSettings.ThrowIfPropertyNotSet 方法 (String, String)
如果指定的連接屬性是 Null 或空白,就會擲回例外狀況。
命名空間: 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
型別:String
指定連接屬性名稱的字串,例如「登入」。
- str
型別:String
包含屬性值的 String 物件。
傳回值
型別:String
如果字串為 Null 或空白,這個方法會擲回 PropertyNotSetException,否則這個方法會傳回 str 參數值。