C# Класс MySql.Data.MySqlClient.MySqlHelper

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
DoubleQuoteString ( string value ) : string
EscapeString ( string value ) : string

Escapes the string.

ExecuteDataRow ( string connectionString, string commandText ) : DataRow

Executes a single SQL command and returns the first row of the resultset. A new MySqlConnection object is created, opened, and closed during this method.

ExecuteDataset ( MySqlConnection connection, string commandText ) : DataSet

Executes a single SQL command and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.

ExecuteDataset ( string connectionString, string commandText ) : DataSet

Executes a single SQL command and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.

ExecuteNonQuery ( MySqlConnection connection, string commandText ) : int

Executes a single command against a MySQL database. The MySqlConnection is assumed to be open when the method is called and remains open after the method completes.

ExecuteNonQuery ( string connectionString, string commandText ) : int

Executes a single command against a MySQL database. A new MySqlConnection is created using the MySqlConnection.ConnectionString given.

ExecuteReader ( MySqlConnection connection, string commandText ) : MySqlDataReader

Executes a single command against a MySQL database.

ExecuteReader ( string connectionString, string commandText ) : MySqlDataReader

Executes a single command against a MySQL database.

ExecuteScalar ( MySqlConnection connection, string commandText ) : object

Execute a single command against a MySQL database.

ExecuteScalar ( string connectionString, string commandText ) : object

Execute a single command against a MySQL database.

UpdateDataSet ( string connectionString, string commandText, DataSet ds, string tablename ) : void

Updates the given table with data from the given DataSet

Приватные методы

Метод Описание
ExecuteReader ( MySqlConnection connection, MySql.Data.MySqlClient.MySqlTransaction transaction, string commandText, MySqlParameter commandParameters, bool ExternalConn ) : MySqlDataReader

Executes a single command against a MySQL database, possibly inside an existing transaction.

MySqlHelper ( ) : System.Data
makeCharClassArray ( ) : CharClass[]
needsQuoting ( string s ) : bool

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

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

public static DoubleQuoteString ( string value ) : string
value string
Результат string

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

Escapes the string.
public static EscapeString ( string value ) : string
value string The string to escape
Результат string

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

Executes a single SQL command and returns the first row of the resultset. A new MySqlConnection object is created, opened, and closed during this method.
public static ExecuteDataRow ( string connectionString, string commandText ) : DataRow
connectionString string Settings to be used for the connection
commandText string Command to execute
Результат DataRow

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

Executes a single SQL command and returns the resultset in a DataSet. The state of the MySqlConnection object remains unchanged after execution of this method.
public static ExecuteDataset ( MySqlConnection connection, string commandText ) : DataSet
connection MySqlConnection object to use
commandText string Command to execute
Результат DataSet

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

Executes a single SQL command and returns the resultset in a DataSet. A new MySqlConnection object is created, opened, and closed during this method.
public static ExecuteDataset ( string connectionString, string commandText ) : DataSet
connectionString string Settings to be used for the connection
commandText string Command to execute
Результат DataSet

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

Executes a single command against a MySQL database. The MySqlConnection is assumed to be open when the method is called and remains open after the method completes.
public static ExecuteNonQuery ( MySqlConnection connection, string commandText ) : int
connection MySqlConnection object to use
commandText string SQL command to be executed
Результат int

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

Executes a single command against a MySQL database. A new MySqlConnection is created using the MySqlConnection.ConnectionString given.
public static ExecuteNonQuery ( string connectionString, string commandText ) : int
connectionString string to use
commandText string SQL command to be executed
Результат int

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

Executes a single command against a MySQL database.
public static ExecuteReader ( MySqlConnection connection, string commandText ) : MySqlDataReader
connection MySqlConnection object to use for the command
commandText string Command text to use
Результат MySqlDataReader

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

Executes a single command against a MySQL database.
public static ExecuteReader ( string connectionString, string commandText ) : MySqlDataReader
connectionString string Settings to use for this command
commandText string Command text to use
Результат MySqlDataReader

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

Execute a single command against a MySQL database.
public static ExecuteScalar ( MySqlConnection connection, string commandText ) : object
connection MySqlConnection object to use
commandText string Command text to use for the command
Результат object

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

Execute a single command against a MySQL database.
public static ExecuteScalar ( string connectionString, string commandText ) : object
connectionString string Settings to use for the update
commandText string Command text to use for the update
Результат object

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

Updates the given table with data from the given DataSet
public static UpdateDataSet ( string connectionString, string commandText, DataSet ds, string tablename ) : void
connectionString string Settings to use for the update
commandText string Command text to use for the update
ds DataSet containing the new data to use in the update
tablename string Tablename in the dataset to update
Результат void