Example #1
0
        private void CreateSchema()
        {
            if (_idxByTable == null)
            {
                System.Data.DataTable tbl = ActiveConnection.GetSchema(SqliteMetaDataCollectionNames.Tables);
                if (tbl.Rows.Count == 0)
                {
                    return;
                }

                _tablesByIdx = new string[tbl.Rows.Count];
                int idx = 0;
                foreach (System.Data.DataRow row in tbl.Rows)
                {
                    _tablesByIdx[idx] = row[2].ToString();
                    idx++;
                }
                Array.Sort(_tablesByIdx);

                _idxByTable = new Dictionary <string, int>();
                idx         = 0;
                foreach (String s in _tablesByIdx)
                {
                    _idxByTable.Add(s, idx);
                    idx++;
                }
            }
        }