示例#1
0
 public Index(SQLiteConnectionStringBuilder SQLConnSetting, SQLiteDataReader rs, Indexes owner)
 {
     _Owner = owner;
     SQLConnSet.ConnectionString = SQLConnSetting.ConnectionString;
     AddFromRecordSet(rs);
     _IndexColumns = new IndexColumns(SQLConnSet, this);
 }
示例#2
0
        public IndexColumn(SQLiteConnectionStringBuilder SQLConnSetting, int Object_id, int Index_id, int Index_column_id, IndexColumns owner)
        {
            _Owner = owner;
            SQLConnSet.ConnectionString = SQLConnSetting.ConnectionString;

            using (SQLiteConnection Conn = new SQLiteConnection(SQLConnSet.ConnectionString))
            {
                Conn.Open();
                using (SQLiteCommand Com = Conn.CreateCommand())
                {
                    Com.CommandTimeout = 10;
                    Com.CommandText    = "SELECT object_id, index_id, index_column_id, column_id, key_ordinal, partition_ordinal, is_descending_key, is_included_column FROM sys.index_columns WHERE object_id=" + Object_id + " AND index_id=" + Index_id + " AND index_column_id=" + Index_column_id + " ORDER BY index_column_id";
                    SQLiteDataReader rs = Com.ExecuteReader();
                    while (rs.Read())
                    {
                        AddFromRecordSet(rs);
                    }
                    rs.Close();
                    Conn.Close();
                    rs.Dispose();
                }
            }
        }
示例#3
0
        public Index(SQLiteConnectionStringBuilder SQLConnSetting, int Object_id, int Index_id, Indexes owner)
        {
            _Owner = owner;
            SQLConnSet.ConnectionString = SQLConnSetting.ConnectionString;

            using (SQLiteConnection Conn = new SQLiteConnection(SQLConnSet.ConnectionString))
            {
                Conn.Open();
                using (SQLiteCommand Com = Conn.CreateCommand())
                {
                    Com.CommandTimeout = 10;
                    Com.CommandText    = "SELECT object_id, name, index_id, type, type_desc, is_unique, data_space_id, ignore_dup_key, is_primary_key, is_unique_constraint, fill_factor, is_padded, is_disabled, is_hypothetical, allow_row_locks, allow_page_locks FROM sys.indexes WHERE object_id=" + Object_id + " AND index_id=" + Index_id + " ORDER BY name";
                    SQLiteDataReader rs = Com.ExecuteReader();
                    while (rs.Read())
                    {
                        AddFromRecordSet(rs);
                    }
                    rs.Close();
                    Conn.Close();
                    rs.Dispose();
                }
            }
            _IndexColumns = new IndexColumns(SQLConnSet, this);
        }