Subtext.Installation.SqlInstaller.GetCurrentInstallationVersion C# (CSharp) Method

GetCurrentInstallationVersion() public method

Gets the Version of the current Subtext data store (ie. SQL Server). This is the value stored in the database. If it does not match the actual assembly version, we may need to run an upgrade.
public GetCurrentInstallationVersion ( ) : System.Version
return System.Version
        public Version GetCurrentInstallationVersion()
        {
            string sql = "subtext_VersionGetCurrent";

            try
            {
                using (IDataReader reader = SqlHelper.ExecuteReader(this.connectionString, CommandType.StoredProcedure, sql))
                {
                    if (reader.Read())
                    {
                        Version version = new Version((int)reader["Major"], (int)reader["Minor"], (int)reader["Build"]);
                        reader.Close();
                        return version;
                    }
                    reader.Close();
                }
            }
            catch (SqlException exception)
            {
                if (exception.Number != (int)SqlErrorMessage.CouldNotFindStoredProcedure)
                    throw;
            }
            return null;
        }