# C1.DataConnector.SourceTable.LoadFromReader

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_DataConnector_SourceTable_LoadFromReader_" data-uid="C1.DataConnector.SourceTable.LoadFromReader*">LoadFromReader Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_DataConnector_SourceTable_LoadFromReader_" data-uid="C1.DataConnector.SourceTable.LoadFromReader*"></a>
<h4 id="C1_DataConnector_SourceTable_LoadFromReader_System_Data_Common_DbDataReader_System_String_System_Action_System_Type___" data-uid="C1.DataConnector.SourceTable.LoadFromReader(System.Data.Common.DbDataReader,System.String,System.Action,System.Type[])">LoadFromReader(DbDataReader, string, Action, Type[])</h4>
<div class="markdown level1 summary"><p>Create a <a class="xref" href="C1.DataConnector.SourceTable.html">SourceTable</a> from a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader">DbDataReader</a>. All datarows will be loaded into memory.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static SourceTable LoadFromReader(DbDataReader reader, string newTableName, Action dispose, Type[] columnTypeConversions = null)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function LoadFromReader(reader As DbDataReader, newTableName As String, dispose As Action, Optional columnTypeConversions As Type() = Nothing) As SourceTable</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader">DbDataReader</a></td>
      <td><span class="parametername">reader</span></td>
      <td><p>An open <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader">DbDataReader</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">newTableName</span></td>
      <td><p>Name of newly-created <a class="xref" href="C1.DataConnector.SourceTable.html">SourceTable</a>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action">Action</a></td>
      <td><span class="parametername">dispose</span></td>
      <td><p>This action will be invoked when this <a class="xref" href="C1.DataConnector.SourceTable.html">SourceTable</a> instance is being disposed.
In normal cases it's used to release resources like <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbdatareader">DbDataReader</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand">DbCommand</a> and <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection">DbConnection</a>.
Set null to do nothing.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a>[]</td>
      <td><span class="parametername">columnTypeConversions</span></td>
      <td><p>Optional parameter that must be used if it desired to convert a retrieved field of a row to a specific type.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.DataConnector.SourceTable.html">SourceTable</a></td>
      <td><p>A <a class="xref" href="C1.DataConnector.SourceTable.html">SourceTable</a></p>
</td>
    </tr>
  </tbody>
</table>
</div>
