Exemplo n.º 1
0
 protected virtual IDataTableColumn ReadColumn(IDataReader dataReader, string table)
 {
     var column = new DataTableColumn();
     column.TableSchema = "main";
     column.TableName = table;
     column.ColumnName = dataReader.GetString(1);
     column.UnpackRawDbType(dataReader.GetString(2));
     column.FullType = dataReader.GetString(2);
     column.Nullable = dataReader.GetInt64(3) == 0;
     column.PrimaryKey = dataReader.GetInt64(5) == 1;
     // SQLite says: if it is a primary key of integer type, then it is automatically generated
     column.Generated = column.PrimaryKey.Value && MapDbType(column.ColumnName, column) == typeof(int);
     return column;
 }
Exemplo n.º 2
0
        protected virtual IDataTableColumn ReadColumn(IDataReader dataReader)
        {
            var column = new DataTableColumn();

            column.TableSchema = "main";
            column.TableName   = column.ColumnName = dataReader.GetString(0);
            column.ColumnName  = dataReader.GetString(1);
            column.UnpackRawDbType(dataReader.GetString(2));
            column.FullType = dataReader.GetString(2);
            column.Nullable = dataReader.GetString(3) != "NO";
            // SqlCe says: if it is a primary key of integer type, then it is automatically generated
            // column.Generated = column.PrimaryKey.Value && MapDbType(column.ColumnName, column) == typeof(int);
            return(column);
        }
Exemplo n.º 3
0
        protected virtual IDataTableColumn ReadColumn(IDataReader dataReader, string table)
        {
            var column = new DataTableColumn();

            column.TableSchema = "main";
            column.TableName   = table;
            column.ColumnName  = dataReader.GetString(1);
            column.UnpackRawDbType(dataReader.GetString(2));
            column.FullType   = dataReader.GetString(2);
            column.Nullable   = dataReader.GetInt64(3) == 0;
            column.PrimaryKey = dataReader.GetInt64(5) == 1;
            // SQLite says: if it is a primary key of integer type, then it is automatically generated
            column.Generated = column.PrimaryKey.Value && MapDbType(column.ColumnName, column) == typeof(int);
            return(column);
        }