dotConnect for DB2 Documentation
Devart.Common Namespace / DbDataTable Class / ReadComplete Method
Row to read out.
Example

In This Topic
    ReadComplete Method
    In This Topic
    Fills a row with data not fetched in the initial fill operation.
    Syntax
    'Declaration
     
    Public Sub ReadComplete( _
       ByVal row As DataRow _
    ) 
    public void ReadComplete( 
       DataRow row
    )

    Parameters

    row
    Row to read out.
    Remarks
    This method is designed to optimize working with LOBs and other big-size server types. It allows you to execute initial fill with only a subset of fields (e.g. all except LOBs). Then you can can create missing columns manually and call ReadComplete for the row you want to get data for.
    Example
    The following example demonstrates how to use the ReadComplete property.
    static void UseDataTable(DbDataTable myDataTable, DbConnection myConnection) {
    
      myDataTable.Connection = myConnection;
      myDataTable.SelectCommand = myConnection.CreateCommand();
      myDataTable.SelectCommand.CommandText = "SELECT DEPTNO FROM Dept";
    
      System.Data.DataColumn column_DEPTNO = new System.Data.DataColumn();
      System.Data.DataColumn column_DNAME = new System.Data.DataColumn();
      System.Data.DataColumn column_LOC = new System.Data.DataColumn();
      column_DEPTNO.ColumnName = "DEPTNO";
      column_DEPTNO.DataType = typeof(int);
      column_LOC.ColumnName = "LOC";
      column_DEPTNO.DataType = typeof(string);
      myDataTable.Columns.AddRange(new System.Data.DataColumn[] {column_DEPTNO, column_DNAME, column_LOC});
    
      myDataTable.FetchAll = true;
      myDataTable.Open();
    
      Console.Write("DEPTNO column is loaded");
    
      myDataTable.ReadComplete(myDataTable.Rows[0]);
      
      Console.Write("DEPTNO and LOC columns are loaded");
    }
    Private Shared Sub UseDataTable(ByVal myDataTable As DbDataTable, ByVal myConnection As DbConnection)
      myDataTable.Connection = myConnection
      myDataTable.SelectCommand = myConnection.CreateCommand
      myDataTable.SelectCommand.CommandText = "SELECT DEPTNO FROM Dept"
      Dim column1 As New DataColumn
      Dim column2 As New DataColumn
      Dim column3 As New DataColumn
      column1.ColumnName = "DEPTNO"
      column1.DataType = GetType(Integer)
      column3.ColumnName = "LOC"
      column1.DataType = GetType(String)
      myDataTable.Columns.AddRange(New DataColumn() {column1, column2, column3})
      myDataTable.FetchAll = True
      myDataTable.Open()
      Console.Write("DEPTNO column is loaded")
      myDataTable.ReadComplete(myDataTable.Rows.Item(0))
      Console.Write("DEPTNO and LOC columns are loaded")
    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