C# Класс Azavea.NijPredictivePolicing.Parsers.AccessDBValueWriter

a basic implementation of the IDataWriter interface, so we can simply export tab separated value files
Наследование: IDataFileWriter
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
_conn System.Data.Common.DbConnection
_filename string
_insertCmd System.Data.Common.DbCommand
_tablename string
_tablenames List

Открытые методы

Метод Описание
AccessDBValueWriter ( ) : System

construct a new blank writer (any writes will throw exceptions if you don't set a stream or a file!)

AccessDBValueWriter ( string filename ) : System

construct a new writer to append to the given file

Close ( ) : bool

closes the underlying stream

CreateTable ( string tablename, IEnumerable columns ) : bool
Flush ( ) : bool

flushes the stream

IsOpen ( ) : bool

returns true if the database connection is open and ready

SetTablename ( string tableName ) : void
SetWriteFile ( string filename ) : bool

Opens or creates an MS Access database file for writing

TableNames ( ) : List

pulls a list of datatable names from the database and caches them. (this list does not refresh, because this reader is read-only)

WriteLine ( IEnumerable values ) : bool

Make sure you have a value for every column! This is really intentionally not thread safe, do not share this class across threads.

Описание методов

AccessDBValueWriter() публичный Метод

construct a new blank writer (any writes will throw exceptions if you don't set a stream or a file!)
public AccessDBValueWriter ( ) : System
Результат System

AccessDBValueWriter() публичный Метод

construct a new writer to append to the given file
public AccessDBValueWriter ( string filename ) : System
filename string
Результат System

Close() публичный Метод

closes the underlying stream
public Close ( ) : bool
Результат bool

CreateTable() публичный Метод

public CreateTable ( string tablename, IEnumerable columns ) : bool
tablename string
columns IEnumerable
Результат bool

Flush() публичный Метод

flushes the stream
public Flush ( ) : bool
Результат bool

IsOpen() публичный Метод

returns true if the database connection is open and ready
public IsOpen ( ) : bool
Результат bool

SetTablename() публичный Метод

public SetTablename ( string tableName ) : void
tableName string
Результат void

SetWriteFile() публичный Метод

Opens or creates an MS Access database file for writing
public SetWriteFile ( string filename ) : bool
filename string
Результат bool

TableNames() публичный Метод

pulls a list of datatable names from the database and caches them. (this list does not refresh, because this reader is read-only)
public TableNames ( ) : List
Результат List

WriteLine() публичный Метод

Make sure you have a value for every column! This is really intentionally not thread safe, do not share this class across threads.
public WriteLine ( IEnumerable values ) : bool
values IEnumerable
Результат bool

Описание свойств

_conn защищенное свойство

an open connection to the database (opened when constructed, or from LoadFile)
protected DbConnection,System.Data.Common _conn
Результат System.Data.Common.DbConnection

_filename защищенное свойство

the ms access database filename
protected string _filename
Результат string

_insertCmd защищенное свойство

a reusable parameterized insert command to help speed up our writer.
protected DbCommand,System.Data.Common _insertCmd
Результат System.Data.Common.DbCommand

_tablename защищенное свойство

the currently selected table name in the ms access database
protected string _tablename
Результат string

_tablenames защищенное свойство

a one-time cached of tables available in the database
protected List _tablenames
Результат List