dotConnect for Oracle Documentation
Devart.Data.Oracle Namespace / OracleLoader Class / OracleLoader Constructor / OracleLoader Constructor(String,OracleConnection)
Name of the table that will be loaded.
A OracleConnection object that represents the connection to a data source.
Example

In This Topic
    OracleLoader Constructor(String,OracleConnection)
    In This Topic
    Initializes a new instance of the OracleLoader class with table name that will be loaded and a OracleConnection object.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal tableName As String, _
       ByVal connection As OracleConnection _
    )
    public OracleLoader( 
       string tableName,
       OracleConnection connection
    )

    Parameters

    tableName
    Name of the table that will be loaded.
    connection
    A OracleConnection object that represents the connection to a data source.
    Remarks
    Use this constructor to set TableName and Connection properties at the time of initialization.
    Example
    The following example creates a OracleLoader and sets some of its properties. Then prepares data and loads it into the table.
    public void CreateMyLoader()
    {
      // Create and open connection
      OracleConnection conn = new OracleConnection(
          "User Id=Scott;Password=tiger;Data Source=Ora;");
      conn.Open();
    
      // Create loader instance
      OracleLoader loader = new OracleLoader("loader_test", conn);
         
      // Prepare for loading
      loader.Open();
    
      // Set row values
      for (int i = 0; i < 10000; i++) {
        loader.SetValue(0, i);
        loader.SetValue(1, "test string");
        loader.SetValue(2, DateTime.Now);
        // Load next table row
        loader.NextRow();
      }
    
      // Flush buffer and finish loading
      loader.Close();
    }
    Public Sub CreateMyLoader()
      ' Create and open connection
      Dim conn As OracleConnection = new OracleConnection( _
          "User Id=Scott;Password=tiger;Data Source=Ora;")
      conn.Open()
    
      ' Create loader instance
      Dim loader As OracleLoader = new OracleLoader("loader_test", conn)
         
      ' Prepare for loading
      loader.Open()
    
      ' Set row values
      Dim i As Integer
      For i = 0 To 10000
        loader.SetValue(0, i)
        loader.SetValue(1, "test string")
        loader.SetValue(2, DateTime.Now)
        ' Load next table row
        loader.NextRow()
      next
    
      ' Flush buffer and finish loading
      loader.Close()
    End Sub
    See Also