Acme.Northwind.Install.SqlServers.CanUseExtendedProperty C# (CSharp) Method

CanUseExtendedProperty() private static method

Determines if we can use extended properties, Azure does NOT allow them
private static CanUseExtendedProperty ( string connectionString ) : bool
connectionString string
return bool
		private static bool CanUseExtendedProperty(string connectionString)
		{
			if (extendedPropertyEnabled == null)
			{
				System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
				try
				{
					conn.ConnectionString = connectionString;
					conn.Open();
					SqlCommand cmdGetExtProp = new SqlCommand();
					cmdGetExtProp.CommandText = "SELECT value FROM ::fn_listextendedproperty('', '', '', '', '', '', '')";
					cmdGetExtProp.CommandType = System.Data.CommandType.Text;
					cmdGetExtProp.Connection = conn;
					cmdGetExtProp.ExecuteNonQuery();
					extendedPropertyEnabled = true;
				}
				catch (Exception ex)
				{
					extendedPropertyEnabled = false;
				}
				finally
				{
					if (conn != null)
						conn.Close();
				}
			}
			return extendedPropertyEnabled.Value;
		}