ConnectionSettings.ThrowIfPropertyNotSet Method (String, String)

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

Namespace:  Microsoft.SqlServer.Management.Common
Assembly:  Microsoft.SqlServer.ConnectionInfo (in Microsoft.SqlServer.ConnectionInfo.dll)

protected string ThrowIfPropertyNotSet(
	string propertyName,
	string str
)

Parameters

propertyName
Type: System.String
A string that specifies the name of the connection property, such as "Login".
str
Type: System.String
A String object that contains the property value.

Return Value

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

Community Additions

ADD
Show: