Scalien.Database.GetTables C# (CSharp) Method

GetTables() public method

Retrieve the tables in the database as a list of Scalien.Table objects.
public GetTables ( ) : List
return List
        public virtual List<Table> GetTables()
        {
            ulong numTables = scaliendb_client.SDBP_GetNumTables(client.cptr, databaseID);
            List<Table> tables = new List<Table>();
            for (uint i = 0; i < numTables; i++)
            {
                ulong tableID = scaliendb_client.SDBP_GetTableIDAt(client.cptr, databaseID, i);
                string name = scaliendb_client.SDBP_GetTableNameAt(client.cptr, databaseID, i);
                tables.Add(new Table(client, this, tableID, name));
            }
            return tables;
        }

Usage Example

Ejemplo n.º 1
0
        public static Database GetOrCreateEmptyDatabase(Client client, string dbName)
        {
            Database db = null;

            try
            {
                db = client.GetDatabase(dbName);
            }
            catch (SDBPException e)
            {
                if (e.Status == Status.SDBP_BADSCHEMA)
                {
                    db = client.CreateDatabase(dbName);
                    return(db);
                }
            }
            if (db == null)
            {
                return(null);
            }

            foreach (Table table in db.GetTables())
            {
                table.DeleteTable();
            }

            return(db);
        }
All Usage Examples Of Scalien.Database::GetTables