dotConnect for Snowflake Documentation
Devart.Data.Snowflake Namespace / SnowflakeLoaderColumn Class
Members Example

On this page
    SnowflakeLoaderColumn Class
    On this page
    Represents the attributes for column loading.
    Syntax
    'Declaration
     
    Public Class SnowflakeLoaderColumn 
       Inherits Devart.Common.DbLoaderColumn
    public class SnowflakeLoaderColumn : Devart.Common.DbLoaderColumn 
    Remarks

    Each SnowflakeLoaderBase uses a Columns to maintain a collection of SnowflakeLoaderColumn objects. The SnowflakeLoaderColumn object represents the attributes for column loading. Every SnowflakeLoaderColumn object corresponds to one of the table fields with the same name as its Name property.

    You can manually make changes to the Columns collection to exclude some columns from INSERT statement generated by SnowflakeLoaderBase object.

    Example
    This sample shows how to perform loading of data into a table with the last column set to default value.
    public void LoadData(SnowflakeConnection snowflakeConnection)
    {
      snowflakeConnection.Open();
      SnowflakeInternalLoader loader = new SnowflakeInternalLoader();
      loader.Connection = snowflakeConnection;
      loader.TableName = "LOAD_TABLE";
      try
      {
        loader.CreateColumns();
        //Do not insert data in the last column
        loader.Columns.RemoveAt(loader.Columns.Count-1);
        loader.Open();
        for (int i = 1; i <= 100; i++)
        {
          loader.SetValue("ID", i);
          loader.SetValue(1, "test string");
          loader.SetValue("DATE_FIELD", DateTime.Now);
          loader.NextRow();
        }
        loader.Close();
      }
      finally
      {
        snowflakeConnection.Close();
      }
    }
    Public Sub LoadData(ByVal snowflakeConnection As SnowflakeConnection)
      snowflakeConnection.Open()
      Dim loader As SnowflakeInternalLoader
      loader = New SnowflakeInternalLoader
      loader.Connection = snowflakeConnection
      loader.TableName = "LOAD_TABLE"
      Try
        loader.CreateColumns()
        ' Do not insert data in the last column
        loader.Columns.RemoveAt(loader.Columns.Count - 1)
        loader.Open()
        Dim i As Integer
        For i = 1 To 100
          loader.SetValue("ID", i)
          loader.SetValue(1, "test string")
          loader.SetValue("DATE_FIELD", DateTime.Now)
          loader.NextRow()
        Next i
        loader.Close()
      Finally
        snowflakeConnection.Close()
      End Try
    End Sub
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          Devart.Common.DbLoaderColumn
             Devart.Data.Snowflake.SnowflakeLoaderColumn

    See Also