C# 클래스 BF2Statistics.Database.QueryBuilder.InsertQueryBuilder

Provides an object interface that can properly put together an Insert Query string.
All parameters in the WHERE and HAVING statements will be escaped by the underlaying DbCommand object, making the Execute*() methods SQL injection safe.
파일 보기 프로젝트 열기: BF2Statistics/ControlCenter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
Table string

보호된 프로퍼티들

프로퍼티 타입 설명
Driver DatabaseDriver
Fields object>.Dictionary

공개 메소드들

메소드 설명
BuildCommand ( ) : DbCommand

Builds the query string with the current SQL Statement, and returns the DbCommand to be executed. All WHERE paramenters are propery escaped, making this command SQL Injection safe.

BuildQuery ( ) : string

Builds the query string with the current SQL Statement, and returns the querystring. This method is NOT Sql Injection safe!

Execute ( ) : int

Executes the built SQL statement on the Database connection that was passed in the contructor. All WHERE paramenters are propery escaped, making this command SQL Injection safe.

InsertQueryBuilder ( DatabaseDriver Driver ) : System

Creates a new instance of InsertQueryBuilder with the provided Database Driver.

InsertQueryBuilder ( string Table, DatabaseDriver Driver ) : System

Creates a new instance of InsertQueryBuilder with the provided Database Driver.

SetDbDriver ( DatabaseDriver Driver ) : void

Sets the database driver

SetField ( string Field, object Value ) : void

Sets a value for the specified field

SetTable ( string Table ) : void

Sets the table name to inesrt into

보호된 메소드들

메소드 설명
BuildQuery ( bool BuildCommand ) : object

Builds the query string or DbCommand

메소드 상세

BuildCommand() 공개 메소드

Builds the query string with the current SQL Statement, and returns the DbCommand to be executed. All WHERE paramenters are propery escaped, making this command SQL Injection safe.
public BuildCommand ( ) : DbCommand
리턴 System.Data.Common.DbCommand

BuildQuery() 보호된 메소드

Builds the query string or DbCommand
protected BuildQuery ( bool BuildCommand ) : object
BuildCommand bool
리턴 object

BuildQuery() 공개 메소드

Builds the query string with the current SQL Statement, and returns the querystring. This method is NOT Sql Injection safe!
public BuildQuery ( ) : string
리턴 string

Execute() 공개 메소드

Executes the built SQL statement on the Database connection that was passed in the contructor. All WHERE paramenters are propery escaped, making this command SQL Injection safe.
public Execute ( ) : int
리턴 int

InsertQueryBuilder() 공개 메소드

Creates a new instance of InsertQueryBuilder with the provided Database Driver.
public InsertQueryBuilder ( DatabaseDriver Driver ) : System
Driver DatabaseDriver The DatabaseDriver that will be used to query this SQL statement
리턴 System

InsertQueryBuilder() 공개 메소드

Creates a new instance of InsertQueryBuilder with the provided Database Driver.
public InsertQueryBuilder ( string Table, DatabaseDriver Driver ) : System
Table string The table we are inserting into
Driver DatabaseDriver The DatabaseDriver that will be used to query this SQL statement
리턴 System

SetDbDriver() 공개 메소드

Sets the database driver
public SetDbDriver ( DatabaseDriver Driver ) : void
Driver DatabaseDriver
리턴 void

SetField() 공개 메소드

Sets a value for the specified field
public SetField ( string Field, object Value ) : void
Field string The column or field name
Value object The value to insert
리턴 void

SetTable() 공개 메소드

Sets the table name to inesrt into
public SetTable ( string Table ) : void
Table string The name of the table to insert into
리턴 void

프로퍼티 상세

Driver 보호되어 있는 프로퍼티

The database driver, if using the "BuildCommand" method
protected DatabaseDriver Driver
리턴 DatabaseDriver

Fields 보호되어 있는 프로퍼티

A list of FieldValuePairs
protected Dictionary Fields
리턴 object>.Dictionary

Table 공개적으로 프로퍼티

The table name to query
public string Table
리턴 string