Class MySqlHelper
Helper class that makes it easier to work with the provider.
Inheritance
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
public sealed class MySqlHelper
Methods
DoubleQuoteString(String)
Replaces quotes with double quotes.
Declaration
public static string DoubleQuoteString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string to modidify. |
Returns
Type | Description |
---|---|
System.String | A string containing double quotes instead of single quotes. |
EscapeString(String)
Escapes the string.
Declaration
public static string EscapeString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The string to escape. |
Returns
Type | Description |
---|---|
System.String | The string with all quotes escaped. |
ExecuteDataRow(String, String, MySqlParameter[])
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.
Declaration
public static DataRow ExecuteDataRow(string connectionString, string commandText, params MySqlParameter[] parms)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to be used for the connection |
System.String | commandText | Command to execute |
MySqlParameter[] | parms | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Data.DataRow | DataRow containing the first row of the resultset |
ExecuteDataRowAsync(String, String, MySqlParameter[])
Asynchronous version of ExecuteDataRow.
Declaration
public static Task<DataRow> ExecuteDataRowAsync(string connectionString, string commandText, params MySqlParameter[] parms)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | The settings to be used for the connection. |
System.String | commandText | The command to execute. |
MySqlParameter[] | parms | The parameters to use for the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataRow> | The DataRow containing the first row of the resultset. |
ExecuteDataRowAsync(String, String, CancellationToken, MySqlParameter[])
Asynchronous version of ExecuteDataRow.
Declaration
public static Task<DataRow> ExecuteDataRowAsync(string connectionString, string commandText, CancellationToken cancellationToken, params MySqlParameter[] parms)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | The settings to be used for the connection. |
System.String | commandText | The command to execute. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
MySqlParameter[] | parms | The parameters to use for the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataRow> | The DataRow containing the first row of the resultset. |
ExecuteDataset(MySqlConnection, String)
Executes a single SQL command and returns the resultset in a System.Data.DataSet.
The state of the MySqlConnection object remains unchanged after execution
of this method.
Declaration
public static DataSet ExecuteDataset(MySqlConnection connection, string commandText)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command to execute |
Returns
Type | Description |
---|---|
System.Data.DataSet | System.Data.DataSet containing the resultset |
ExecuteDataset(MySqlConnection, String, MySqlParameter[])
Executes a single SQL command and returns the resultset in a System.Data.DataSet.
The state of the MySqlConnection object remains unchanged after execution
of this method.
Declaration
public static DataSet ExecuteDataset(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command to execute |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Data.DataSet | System.Data.DataSet containing the resultset |
ExecuteDataset(String, String)
Executes a single SQL command and returns the resultset in a System.Data.DataSet.
A new MySqlConnection object is created, opened, and closed during this method.
Declaration
public static DataSet ExecuteDataset(string connectionString, string commandText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to be used for the connection |
System.String | commandText | Command to execute |
Returns
Type | Description |
---|---|
System.Data.DataSet | System.Data.DataSet containing the resultset |
ExecuteDataset(String, String, MySqlParameter[])
Executes a single SQL command and returns the resultset in a System.Data.DataSet.
A new MySqlConnection object is created, opened, and closed during this method.
Declaration
public static DataSet ExecuteDataset(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to be used for the connection |
System.String | commandText | Command to execute |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Data.DataSet | System.Data.DataSet containing the resultset |
ExecuteDatasetAsync(MySqlConnection, String)
Async version of ExecuteDataset
Declaration
public static Task<DataSet> ExecuteDatasetAsync(MySqlConnection connection, string commandText)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command to execute |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> | System.Data.DataSet containing the resultset |
ExecuteDatasetAsync(MySqlConnection, String, MySqlParameter[])
Async version of ExecuteDataset
Declaration
public static Task<DataSet> ExecuteDatasetAsync(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command to execute |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> | System.Data.DataSet containing the resultset |
ExecuteDatasetAsync(MySqlConnection, String, CancellationToken)
Declaration
public static Task<DataSet> ExecuteDatasetAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> |
ExecuteDatasetAsync(MySqlConnection, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<DataSet> ExecuteDatasetAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> |
ExecuteDatasetAsync(String, String)
Async version of ExecuteDataset
Declaration
public static Task<DataSet> ExecuteDatasetAsync(string connectionString, string commandText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to be used for the connection |
System.String | commandText | Command to execute |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> | System.Data.DataSet containing the resultset |
ExecuteDatasetAsync(String, String, MySqlParameter[])
Async version of ExecuteDataset
Declaration
public static Task<DataSet> ExecuteDatasetAsync(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to be used for the connection |
System.String | commandText | Command to execute |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> | System.Data.DataSet containing the resultset |
ExecuteDatasetAsync(String, String, CancellationToken)
Declaration
public static Task<DataSet> ExecuteDatasetAsync(string connectionString, string commandText, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> |
ExecuteDatasetAsync(String, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<DataSet> ExecuteDatasetAsync(string connectionString, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Data.DataSet> |
ExecuteNonQuery(MySqlConnection, String, MySqlParameter[])
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.
Declaration
public static int ExecuteNonQuery(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | The MySqlConnection object to use |
System.String | commandText | The SQL command to be executed. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Int32 | The number of affected records. |
ExecuteNonQuery(String, String, MySqlParameter[])
Executes a single command against a MySQL database.
Declaration
public static int ExecuteNonQuery(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | ConnectionString to use. |
System.String | commandText | The SQL command to be executed. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Int32 | The number of affected records. |
Remarks
A new MySqlConnection is created using the ConnectionString given.
ExecuteNonQueryAsync(MySqlConnection, String, MySqlParameter[])
Async version of ExecuteNonQuery
Declaration
public static Task<int> ExecuteNonQueryAsync(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use. |
System.String | commandText | The SQL command to be executed. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> | Rows affected. |
ExecuteNonQueryAsync(MySqlConnection, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<int> ExecuteNonQueryAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> |
ExecuteNonQueryAsync(String, String, MySqlParameter[])
Asynchronous version of the ExecuteNonQuery method.
Declaration
public static Task<int> ExecuteNonQueryAsync(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | ConnectionString to use. |
System.String | commandText | The SQL command to be executed. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> | The number of rows affected. |
ExecuteNonQueryAsync(String, String, CancellationToken, MySqlParameter[])
Asynchronous version of the ExecuteNonQuery method.
Declaration
public static Task<int> ExecuteNonQueryAsync(string connectionString, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | ConnectionString to use. |
System.String | commandText | The SQL command to be executed. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Int32> | The number of rows affected. |
ExecuteReader(MySqlConnection, String)
Executes a single command against a MySQL database.
Declaration
public static MySqlDataReader ExecuteReader(MySqlConnection connection, string commandText)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use for the command |
System.String | commandText | Command text to use |
Returns
Type | Description |
---|---|
MySqlDataReader | MySqlDataReader object ready to read the results of the command |
ExecuteReader(MySqlConnection, String, MySqlParameter[])
Executes a single command against a MySQL database.
Declaration
public static MySqlDataReader ExecuteReader(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | Connection to use for the command |
System.String | commandText | Command text to use |
MySqlParameter[] | commandParameters | Array of MySqlParameter objects to use with the command |
Returns
Type | Description |
---|---|
MySqlDataReader | MySqlDataReader object ready to read the results of the command |
ExecuteReader(String, String)
Executes a single command against a MySQL database.
Declaration
public static MySqlDataReader ExecuteReader(string connectionString, string commandText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for this command |
System.String | commandText | Command text to use |
Returns
Type | Description |
---|---|
MySqlDataReader | MySqlDataReader object ready to read the results of the command |
ExecuteReader(String, String, MySqlParameter[])
Executes a single command against a MySQL database.
Declaration
public static MySqlDataReader ExecuteReader(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for this command |
System.String | commandText | Command text to use |
MySqlParameter[] | commandParameters | Array of MySqlParameter objects to use with the command |
Returns
Type | Description |
---|---|
MySqlDataReader | MySqlDataReader object ready to read the results of the command |
ExecuteReaderAsync(MySqlConnection, String)
Async version of ExecuteReader
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(MySqlConnection connection, string commandText)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use for the command |
System.String | commandText | Command text to use |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> | MySqlDataReader object ready to read the results of the command |
ExecuteReaderAsync(MySqlConnection, String, MySqlParameter[])
Async version of ExecuteReader
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | Connection to use for the command. |
System.String | commandText | Command text to use. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> | MySqlDataReader object ready to read the results of the command. |
ExecuteReaderAsync(MySqlConnection, String, CancellationToken)
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> |
ExecuteReaderAsync(MySqlConnection, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> |
ExecuteReaderAsync(String, String)
Async version of ExecuteReader
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(string connectionString, string commandText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for this command |
System.String | commandText | Command text to use |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> | MySqlDataReader object ready to read the results of the command |
ExecuteReaderAsync(String, String, MySqlParameter[])
Async version of ExecuteReader
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for this command. |
System.String | commandText | Command text to use. |
MySqlParameter[] | commandParameters | An array of MySqlParameter objects to use with the command. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> | MySqlDataReader object ready to read the results of the command. |
ExecuteReaderAsync(String, String, CancellationToken)
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(string connectionString, string commandText, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> |
ExecuteReaderAsync(String, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<MySqlDataReader> ExecuteReaderAsync(string connectionString, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<MySqlDataReader> |
ExecuteScalar(MySqlConnection, String)
Execute a single command against a MySQL database.
Declaration
public static object ExecuteScalar(MySqlConnection connection, string commandText)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command text to use for the command |
Returns
Type | Description |
---|---|
System.Object | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalar(MySqlConnection, String, MySqlParameter[])
Execute a single command against a MySQL database.
Declaration
public static object ExecuteScalar(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command text to use for the command |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Object | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalar(String, String)
Execute a single command against a MySQL database.
Declaration
public static object ExecuteScalar(string connectionString, string commandText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for the update |
System.String | commandText | Command text to use for the update |
Returns
Type | Description |
---|---|
System.Object | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalar(String, String, MySqlParameter[])
Execute a single command against a MySQL database.
Declaration
public static object ExecuteScalar(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for the command |
System.String | commandText | Command text to use for the command |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Object | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalarAsync(MySqlConnection, String)
Async version of ExecuteScalar
Declaration
public static Task<object> ExecuteScalarAsync(MySqlConnection connection, string commandText)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command text to use for the command |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalarAsync(MySqlConnection, String, MySqlParameter[])
Async version of ExecuteScalar
Declaration
public static Task<object> ExecuteScalarAsync(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | MySqlConnection object to use |
System.String | commandText | Command text to use for the command |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalarAsync(MySqlConnection, String, CancellationToken)
Declaration
public static Task<object> ExecuteScalarAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> |
ExecuteScalarAsync(MySqlConnection, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<object> ExecuteScalarAsync(MySqlConnection connection, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
MySqlConnection | connection | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> |
ExecuteScalarAsync(String, String)
Async version of ExecuteScalar
Declaration
public static Task<object> ExecuteScalarAsync(string connectionString, string commandText)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for the update |
System.String | commandText | Command text to use for the update |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalarAsync(String, String, MySqlParameter[])
Async version of ExecuteScalar
Declaration
public static Task<object> ExecuteScalarAsync(string connectionString, string commandText, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for the command |
System.String | commandText | Command text to use for the command |
MySqlParameter[] | commandParameters | Parameters to use for the command |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The first column of the first row in the result set, or a null reference if the result set is empty. |
ExecuteScalarAsync(String, String, CancellationToken)
Declaration
public static Task<object> ExecuteScalarAsync(string connectionString, string commandText, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> |
ExecuteScalarAsync(String, String, CancellationToken, MySqlParameter[])
Declaration
public static Task<object> ExecuteScalarAsync(string connectionString, string commandText, CancellationToken cancellationToken, params MySqlParameter[] commandParameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Threading.CancellationToken | cancellationToken | |
MySqlParameter[] | commandParameters |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> |
UpdateDataSet(String, String, DataSet, String)
Updates the given table with data from the given System.Data.DataSet
Declaration
public static void UpdateDataSet(string connectionString, string commandText, DataSet ds, string tablename)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for the update |
System.String | commandText | Command text to use for the update |
System.Data.DataSet | ds | System.Data.DataSet containing the new data to use in the update |
System.String | tablename | Tablename in the dataset to update |
UpdateDataSetAsync(String, String, DataSet, String)
Async version of UpdateDataset
Declaration
public static Task UpdateDataSetAsync(string connectionString, string commandText, DataSet ds, string tablename)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | Settings to use for the update |
System.String | commandText | Command text to use for the update |
System.Data.DataSet | ds | System.Data.DataSet containing the new data to use in the update |
System.String | tablename | Tablename in the dataset to update |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
UpdateDataSetAsync(String, String, DataSet, String, CancellationToken)
Declaration
public static Task UpdateDataSetAsync(string connectionString, string commandText, DataSet ds, string tablename, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | |
System.String | commandText | |
System.Data.DataSet | ds | |
System.String | tablename | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |