dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlLoaderColumnCollection Class / Add Method / Add(String,MySqlType,Int32,Int32,Int32) Method
The name of the column.
One of the MySqlType values.
Maximum size of the column data (for strings only).
The precision of the column.
The scale of the column.
Example

In This Topic
    Add(String,MySqlType,Int32,Int32,Int32) Method
    In This Topic
    Adds a MySqlLoaderColumn to the MySqlLoaderColumnCollection given the column name, column data type, column size, precision, and scale.
    Syntax
    'Declaration
     
    Public Overloads Function Add( _
       ByVal name As String, _
       ByVal dbType As MySqlType, _
       ByVal size As Integer, _
       ByVal precision As Integer, _
       ByVal scale As Integer _
    ) As Integer
    public int Add( 
       string name,
       MySqlType dbType,
       int size,
       int precision,
       int scale
    )

    Parameters

    name
    The name of the column.
    dbType
    One of the MySqlType values.
    size
    Maximum size of the column data (for strings only).
    precision
    The precision of the column.
    scale
    The scale of the column.

    Return Value

    The new column's ordinal.
    Example
    The following example creates a MySqlLoaderColumnCollection, adds an instance of MySqlLoaderColumn to the collection, and returns a reference to the new MySqlLoaderColumn.
    public void CreateMyLoaderColumnColl(MySqlLoader myLoader)
    {
      MySqlLoaderColumnCollection myColumnCollection = myLoader.Columns;
      myColumnCollection.Add("DeptNo", MySqlType.Int);
      myColumnCollection.Add("DName", MySqlType.VarChar);
      myColumnCollection.Add("Loc", MySqlType.VarChar);
    }
    Public Sub CreateMyLoaderColumnColl(myLoader As MySqlLoader)
      Dim myColumnCollection As MySqlLoaderColumnCollection = myLoader.Columns
      myColumnCollection.Add("DeptNo", MySqlType.Int)
      myColumnCollection.Add("DName", MySqlType.VarChar)
      myColumnCollection.Add("Loc", MySqlType.VarChar)
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also