Exemple #1
0
 public wDBTable(string name, DatabaseClient root)
 {
     rootLocation = root.currentFolderLocation;
     dbc = root.Clone();
     dbc.SelectDB("$" + name);
     dbc.SetCurrentDBAsRoot();
     dbc.ReturnToRoot();
 }
Exemple #2
0
 public wDBTable(string name, DatabaseClient root)
 {
     rootLocation = root.currentFolderLocation;
     dbc          = root.Clone();
     dbc.SelectDB("$" + name);
     dbc.SetCurrentDBAsRoot();
     dbc.ReturnToRoot();
 }
Exemple #3
0
        public wDBRowCollection GetRows()
        {
            dbc.ReturnToRoot();
            string[]           rowNums = dbc.ListDatabases();
            List <wDBTableRow> rows    = new List <wDBTableRow>();

            for (int i = 0; i < rowNums.Length; i++)
            {
                string rowNum = rowNums[i];
                dbc.SelectDB(rowNum);
                rows.Add(
                    new wDBTableRow(dbc)
                    );
                dbc.ReturnToRoot();
            }
            return(new wDBRowCollection(rows));
        }
Exemple #4
0
        public static void CreateTable(string tableName, DatabaseClient parentDB)
        {
            if (parentDB.ExistDB("$" + tableName) == DatabaseClient.DBResponse.Exists)
            {
                return;
            }
            parentDB.CreateDB("$" + tableName);

            DatabaseClient dbc = parentDB.Clone();

            dbc.SelectDB("$" + tableName);
            dbc.SetValue(".rowsAdded", "0");
        }
Exemple #5
0
        public DatabaseClient SelectDB2(string targetDB, bool autocreate)
        {
            DatabaseClient result   = this.Clone();
            DBResponse     response = result.SelectDB(targetDB, autocreate);

            if (response == DBResponse.doesNotExist)
            {
                return(null);
            }
            else if (response == DBResponse.Selected)
            {
                return(result);
            }
            else
            {
                return(null);
            }
        }