Exemple #1
0
        //private void AddFromRecordSet(SQLiteDataReader rs)
        //{
        //    try
        //    {
        //        if (!rs.IsDBNull(0)) { _create_date = rs.GetDateTime(0); }
        //        if (!rs.IsDBNull(1)) { _filestream_data_space_id = rs.GetInt32(1); }
        //        if (!rs.IsDBNull(2)) { _has_replication_filter = rs.GetBoolean(2); }
        //        if (!rs.IsDBNull(3)) { _has_unchecked_assembly_data = rs.GetBoolean(3); }
        //        if (!rs.IsDBNull(4)) { _is_merge_published = rs.GetBoolean(4); }
        //        if (!rs.IsDBNull(5)) { _is_ms_shipped = rs.GetBoolean(5); }
        //        if (!rs.IsDBNull(6)) { _is_published = rs.GetBoolean(6); }
        //        if (!rs.IsDBNull(7)) { _is_replicated = rs.GetBoolean(7); }
        //        if (!rs.IsDBNull(8)) { _is_schema_published = rs.GetBoolean(8); }
        //        if (!rs.IsDBNull(9)) { _is_sync_tran_subscribed = rs.GetBoolean(9); }
        //        if (!rs.IsDBNull(10)) { _large_value_types_out_of_row = rs.GetBoolean(10); }
        //        if (!rs.IsDBNull(11)) { _lob_data_space_id = rs.GetInt32(11); }
        //        if (!rs.IsDBNull(12)) { _lock_on_bulk_load = rs.GetBoolean(12); }
        //        if (!rs.IsDBNull(13)) { _max_column_id_used = rs.GetInt32(13); }
        //        if (!rs.IsDBNull(14)) { _modify_date = rs.GetDateTime(14); }
        //        if (!rs.IsDBNull(15)) { _name = rs.GetString(15); }
        //        if (!rs.IsDBNull(16)) { _object_id = rs.GetInt32(16); }
        //        if (!rs.IsDBNull(17)) { _parent_object_id = rs.GetInt32(17); }
        //        if (!rs.IsDBNull(18)) { _principal_id = rs.GetInt32(18); }
        //        if (!rs.IsDBNull(19)) { _schema_id = rs.GetInt32(19); }
        //        if (!rs.IsDBNull(20)) { _text_in_row_limit = rs.GetInt32(20); }
        //        if (!rs.IsDBNull(21)) { _type = (Object_Type)Enum.Parse(typeof(Object_Type), rs.GetString(21)); }
        //        if (!rs.IsDBNull(22)) { _type_desc = rs.GetString(22); }
        //        if (!rs.IsDBNull(23)) { _uses_ansi_nulls = rs.GetBoolean(23); }
        //    }
        //    catch (Exception)
        //    {
        //        throw;
        //    }
        //}

        public Table(SQLiteConnectionStringBuilder SQLConnSetting, string _tablename)
        {
            SQLConnSet = SQLConnSetting;

            _Columns         = new Columns(SQLConnSetting, this);
            _Indexes         = new Indexes(SQLConnSet, this);
            _foreign_keys    = new foreign_keys(SQLConnSet, this);
            _Keys            = new KeyConstraints(SQLConnSet, this);
            _IdentityColumns = new IdentityColumns(SQLConnSet, this);
        }
Exemple #2
0
        public IdentityColumn(SQLiteConnectionStringBuilder SQLConnSetting, int object_id, int column_id, IdentityColumns 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, column_id,seed_value, increment_value, last_value, is_not_for_replication FROM sys.identity_columns WHERE object_id=" + object_id + " AND column_id=" + column_id;
                    SQLiteDataReader rs = Com.ExecuteReader();
                    while (rs.Read())
                    {
                        AddFromRecordSet(rs);
                    }
                    rs.Close();
                    Conn.Close();
                    rs.Dispose();
                }
            }
        }
Exemple #3
0
 public IdentityColumn(SQLiteConnectionStringBuilder SQLConnSetting, SQLiteDataReader rs, IdentityColumns owner)
 {
     _Owner = owner;
     SQLConnSet.ConnectionString = SQLConnSetting.ConnectionString;
     AddFromRecordSet(rs);
 }