RDFSharp.Store.RDFSQLServerStore.Diagnostics C# (CSharp) Метод

Diagnostics() приватный Метод

Performs the preliminary diagnostics controls on the underlying SQL Server database
private Diagnostics ( ) : RDFStoreEnums.RDFStoreSQLErrors
Результат RDFStoreEnums.RDFStoreSQLErrors
        private RDFStoreEnums.RDFStoreSQLErrors Diagnostics()
        {
            try {

                //Open connection
                this.Connection.Open();

                //Create command
                var command     = new SqlCommand("SELECT COUNT(*) FROM sys.tables WHERE name='Quadruples' AND type_desc='USER_TABLE'", this.Connection);

                //Execute command
                var result      = Int32.Parse(command.ExecuteScalar().ToString());

                //Close connection
                this.Connection.Close();

                //Return the diagnostics state
                return (result == 0 ? RDFStoreEnums.RDFStoreSQLErrors.QuadruplesTableNotFound : RDFStoreEnums.RDFStoreSQLErrors.NoErrors);

            }
            catch {

                //Close connection
                this.Connection.Close();

                //Return the diagnostics state
                return RDFStoreEnums.RDFStoreSQLErrors.InvalidDataSource;

            }
        }