ChainStoreWeb.Services.AppEventReceiver.CreateTenant C# (CSharp) Method

CreateTenant() private method

private CreateTenant ( string tenantName ) : void
tenantName string
return void
        private void CreateTenant(string tenantName)
        {
            // Do not catch exceptions. Allow them to bubble up and trigger roll back
            // of installation.

            using (SqlConnection conn = SQLAzureUtilities.GetActiveSqlConnection())
            using (SqlCommand cmd = conn.CreateCommand())
            {
                conn.Open();
                cmd.CommandText = "AddTenant";
                cmd.CommandType = CommandType.StoredProcedure;
                SqlParameter name = cmd.Parameters.Add("@Name", SqlDbType.NVarChar);
                name.Value = tenantName;
                cmd.ExecuteNonQuery();
            }//dispose conn and cmd
        }