Class MySqlBulkLoader
Allows importing large amounts of data into a database with bulk loading.
Inheritance
Namespace: MySql.Data.MySqlClient
Assembly: MySql.Data.dll
Version: 9.3.0
Syntax
public class MySqlBulkLoader
Constructors
MySqlBulkLoader(MySqlConnection)
Initializes a new instance of the My
Declaration
public MySqlBulkLoader(MySqlConnection connection)
Parameters
Type | Name | Description |
---|---|---|
My |
connection | The My |
Properties
CharacterSet
Gets or sets the character set.
Declaration
public string CharacterSet { get; set; }
Property Value
Type | Description |
---|---|
System. |
The character set. |
Columns
Gets the columns.
Declaration
public List<string> Columns { get; }
Property Value
Type | Description |
---|---|
System. |
The columns. |
ConflictOption
Gets or sets the conflict option.
Declaration
public MySqlBulkLoaderConflictOption ConflictOption { get; set; }
Property Value
Type | Description |
---|---|
My |
The conflict option. |
Connection
Gets or sets the connection.
Declaration
public MySqlConnection Connection { get; set; }
Property Value
Type | Description |
---|---|
My |
The connection. |
EscapeCharacter
Gets or sets the escape character.
Declaration
public char EscapeCharacter { get; set; }
Property Value
Type | Description |
---|---|
System. |
The escape character. |
Expressions
Gets the expressions.
Declaration
public List<string> Expressions { get; }
Property Value
Type | Description |
---|---|
System. |
The expressions. |
FieldQuotationCharacter
Gets or sets the field quotation character.
Declaration
public char FieldQuotationCharacter { get; set; }
Property Value
Type | Description |
---|---|
System. |
The field quotation character. |
FieldQuotationOptional
Gets or sets a value indicating whether [field quotation optional].
Declaration
public bool FieldQuotationOptional { get; set; }
Property Value
Type | Description |
---|---|
System. |
|
FieldTerminator
Gets or sets the field terminator.
Declaration
public string FieldTerminator { get; set; }
Property Value
Type | Description |
---|---|
System. |
The field terminator. |
FileName
Gets or sets the name of the file.
Declaration
public string FileName { get; set; }
Property Value
Type | Description |
---|---|
System. |
The name of the file. |
LinePrefix
Gets or sets the line prefix.
Declaration
public string LinePrefix { get; set; }
Property Value
Type | Description |
---|---|
System. |
The line prefix. |
LineTerminator
Gets or sets the line terminator.
Declaration
public string LineTerminator { get; set; }
Property Value
Type | Description |
---|---|
System. |
The line terminator. |
Local
Gets or sets a value indicating whether the file name that is to be loaded is local to the client or not. The default value is false.
Declaration
public bool Local { get; set; }
Property Value
Type | Description |
---|---|
System. |
|
NumberOfLinesToSkip
Gets or sets the number of lines to skip.
Declaration
public int NumberOfLinesToSkip { get; set; }
Property Value
Type | Description |
---|---|
System. |
The number of lines to skip. |
Priority
Gets or sets the priority.
Declaration
public MySqlBulkLoaderPriority Priority { get; set; }
Property Value
Type | Description |
---|---|
My |
The priority. |
TableName
Gets or sets the name of the table.
Declaration
public string TableName { get; set; }
Property Value
Type | Description |
---|---|
System. |
The name of the table. |
Timeout
Gets or sets the timeout.
Declaration
public int Timeout { get; set; }
Property Value
Type | Description |
---|---|
System. |
The timeout. |
Methods
Load()
Executes the load operation.
Declaration
public int Load()
Returns
Type | Description |
---|---|
System. |
The number of rows inserted. |
Load(Stream)
Executes the load operation.
Declaration
public int Load(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | A System. |
Returns
Type | Description |
---|---|
System. |
The number of rows inserted. |
LoadAsync()
Asynchronous version of the load operation.
Declaration
public Task<int> LoadAsync()
Returns
Type | Description |
---|---|
System. |
The number of rows inserted. |
LoadAsync(Stream)
Asynchronous version of the load operation that accepts a data stream.
Declaration
public Task<int> LoadAsync(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | A System. |
Returns
Type | Description |
---|---|
System. |
The number of rows inserted. |
LoadAsync(Stream, CancellationToken)
Executes the load operation asynchronously while the cancellation isn't requested.
Declaration
public Task<int> LoadAsync(Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System. |
stream | A System. |
System. |
cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System. |
The number of rows inserted. |