C# Класс Azavea.NijPredictivePolicing.Common.DB.DataClient

Generic helper class for managing database connections and objects
Показать файл Открыть проект

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

Метод Описание
GenerateTableSQLFromFields ( string tablename, List columns ) : string

Convenience function to generate SQL to create a table matching the provided fields

GetDefaultClient ( string hostname ) : IDataClient

Get an instance of the default overridding database type

GetMagicAdapter ( DbConnection conn, IDataClient client, string sql ) : DbDataAdapter

Uses a select statement and the ADO.NET CommandBuilder to generate Insert,Update, and Delete statements, and load them onto an adapter

GetMagicTable ( DbConnection conn, IDataClient client, string sql ) : DataTable

'Magically' populates a DataTable object with the contents of your sql query

HasColumn ( string columnname, string tablename, DbConnection conn, IDataClient client ) : bool

Returns true if a particular table has a particular column

HasTable ( DbConnection conn, IDataClient client, string tablename ) : bool

Checks the schema of the database to see if the given table is present

RowCount ( DbConnection conn, IDataClient client, string tablename ) : int

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

GenerateTableSQLFromFields() публичный статический Метод

Convenience function to generate SQL to create a table matching the provided fields
public static GenerateTableSQLFromFields ( string tablename, List columns ) : string
tablename string the name for the new table
columns List a collection of FixedWidthField objects
Результат string

GetDefaultClient() публичный статический Метод

Get an instance of the default overridding database type
public static GetDefaultClient ( string hostname ) : IDataClient
hostname string
Результат IDataClient

GetMagicAdapter() публичный статический Метод

Uses a select statement and the ADO.NET CommandBuilder to generate Insert,Update, and Delete statements, and load them onto an adapter
public static GetMagicAdapter ( DbConnection conn, IDataClient client, string sql ) : DbDataAdapter
conn System.Data.Common.DbConnection
client IDataClient
sql string
Результат System.Data.Common.DbDataAdapter

GetMagicTable() публичный статический Метод

'Magically' populates a DataTable object with the contents of your sql query
public static GetMagicTable ( DbConnection conn, IDataClient client, string sql ) : DataTable
conn System.Data.Common.DbConnection
client IDataClient
sql string
Результат System.Data.DataTable

HasColumn() публичный статический Метод

Returns true if a particular table has a particular column
public static HasColumn ( string columnname, string tablename, DbConnection conn, IDataClient client ) : bool
columnname string
tablename string
conn System.Data.Common.DbConnection
client IDataClient
Результат bool

HasTable() публичный статический Метод

Checks the schema of the database to see if the given table is present
public static HasTable ( DbConnection conn, IDataClient client, string tablename ) : bool
conn System.Data.Common.DbConnection
client IDataClient
tablename string
Результат bool

RowCount() публичный статический Метод

public static RowCount ( DbConnection conn, IDataClient client, string tablename ) : int
conn System.Data.Common.DbConnection
client IDataClient
tablename string
Результат int