ChainStoreWeb.Pages.Account.ShowAddinVersion C# (CSharp) Method

ShowAddinVersion() private method

private ShowAddinVersion ( ) : void
return void
        private void ShowAddinVersion()
        {
            using (SqlConnection conn = SQLAzureUtilities.GetActiveSqlConnection())
            using (SqlCommand cmd = conn.CreateCommand())
            {
                conn.Open();
                cmd.CommandText = "GetTenantVersion";
                cmd.CommandType = CommandType.StoredProcedure;
                SqlParameter tenant = cmd.Parameters.Add("@Name", SqlDbType.NVarChar);
                tenant.Value = spContext.SPHostUrl.ToString();

                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    string lblText = "Registered version: ";
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            lblText += (reader["Version"].ToString());
                        }
                    }
                    else
                    {
                        lblText = "There is no tenant named: " + spContext.SPHostUrl.ToString();
                    }

                    lblAddinVersion.Text = lblText;
                }
            }
        }