# C1.Report.DataSource

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Report_DataSource" data-uid="C1.Report.DataSource" class="text-break">DataSource Class
</h1>
  <div class="markdown level0 summary"><p>Represnts a data source in a <a class="xref" href="C1.Report.FlexReport.html">FlexReport</a>.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="C1.Report.ReportObject.html">ReportObject</a></div>
    <div class="level2"><a class="xref" href="C1.Report.StrongNamedReportObject.html">StrongNamedReportObject</a></div>
    <div class="level3"><span class="xref">DataSource</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Report.html">C1.Report</a></h6>
  <h6><strong>Assembly</strong>: C1.Report.dll</h6>
  <h5 id="C1_Report_DataSource_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[TypeConverter(typeof(ExpandableObjectConverter))]
public class DataSource : StrongNamedReportObject</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;TypeConverter(GetType(ExpandableObjectConverter))&gt;
Public Class DataSource
    Inherits StrongNamedReportObject</code></pre>
  </div>
  <h5 id="C1_Report_DataSource_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>Most reports specify their data sources by setting the <a class="xref" href="C1.Report.DataSource.ConnectionString.html#C1_Report_DataSource_ConnectionString">ConnectionString</a> and 
<a class="xref" href="C1.Report.DataSource.RecordSource.html#C1_Report_DataSource_RecordSource">RecordSource</a> properties. The <b>DataSource</b> object uses these values to connect
to a database and retrieve the report data.</p>
<p>Alternatively, you can assign data objects directly to the <a class="xref" href="C1.Report.DataSource.Recordset.html#C1_Report_DataSource_Recordset">Recordset</a> property.
This approach is more efficient in scenarios where the data has already been loaded by the 
application for other purposes, and can be used in the report directly instead of loading a copy.</p>
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Report_DataSource__ctor" data-uid="C1.Report.DataSource.#ctor">
          <a class="xref" href="C1.Report.DataSource.-ctor.html#C1_Report_DataSource__ctor">DataSource()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Report.DataSource.html">DataSource</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Report_DataSource_c_DefIsolationLevel" data-uid="C1.Report.DataSource.c_DefIsolationLevel">
          <a class="xref" href="C1.Report.DataSource.c_DefIsolationLevel.html">c_DefIsolationLevel</a>
        </td>
        <td class="markdown level1 summary"><p>Defines default IsolationLevel for transaction used to get report data.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Report_DataSource_CalculatedFields" data-uid="C1.Report.DataSource.CalculatedFields">
          <a class="xref" href="C1.Report.DataSource.CalculatedFields.html#C1_Report_DataSource_CalculatedFields">CalculatedFields</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="C1.Report.CalculatedFieldCollection.html">CalculatedFieldCollection</a> collection defining list of calculated fields for the data source.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_CommandTimeOut" data-uid="C1.Report.DataSource.CommandTimeOut">
          <a class="xref" href="C1.Report.DataSource.CommandTimeOut.html#C1_Report_DataSource_CommandTimeOut">CommandTimeOut</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the number of seconds to wait before the data connection times out
(set to -1 to use the default value, usually 30s).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_ConnectionString" data-uid="C1.Report.DataSource.ConnectionString">
          <a class="xref" href="C1.Report.DataSource.ConnectionString.html#C1_Report_DataSource_ConnectionString">ConnectionString</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the connection string used to open a database.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_DataProvider" data-uid="C1.Report.DataSource.DataProvider">
          <a class="xref" href="C1.Report.DataSource.DataProvider.html#C1_Report_DataSource_DataProvider">DataProvider</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the type of the data source.
The data source type determines the syntaxes of connection string and query (record source).
The default is Auto but it is recommended that you set this value to the specific type of the data source you are using,
as automatic determining of the data source type may be rather slow.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_EncloseParameterValues" data-uid="C1.Report.DataSource.EncloseParameterValues">
          <a class="xref" href="C1.Report.DataSource.EncloseParameterValues.html#C1_Report_DataSource_EncloseParameterValues">EncloseParameterValues</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether values of parameters in resulting SQL query
should be enclosed with delimiters, &quot;#&quot; for dates, &quot;'&quot; for strings, &quot;()&quot; for multivalue parameters.
If this parameter is false when all parameters in <a class="xref" href="C1.Report.DataSource.RecordSource.html#C1_Report_DataSource_RecordSource">RecordSource</a> already should be enclosed.
For example, EncloseParameterValues == true:
RecordSource = &quot;select * from customers where name = CustomerName&quot;;
actual SQL query will be:
select * from customers where name = 'Some customer'</p>
<p>EncloseParameterValues == false:
RecordSource = &quot;select * from customers where name = 'CustomerName'&quot;;
actual SQL query will be:
select * from customers where name = 'Some customer'</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_FactoryName" data-uid="C1.Report.DataSource.FactoryName">
          <a class="xref" href="C1.Report.DataSource.FactoryName.html#C1_Report_DataSource_FactoryName">FactoryName</a>
        </td>
        <td class="markdown level1 summary"><p>The DbFactoryName string used to open a database.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_Filter" data-uid="C1.Report.DataSource.Filter">
          <a class="xref" href="C1.Report.DataSource.Filter.html#C1_Report_DataSource_Filter">Filter</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the expression used to filter which data rows are included in the report.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_FilterSyntax" data-uid="C1.Report.DataSource.FilterSyntax">
          <a class="xref" href="C1.Report.DataSource.FilterSyntax.html#C1_Report_DataSource_FilterSyntax">FilterSyntax</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the type of syntax used in the <a class="xref" href="C1.Report.DataSource.Filter.html#C1_Report_DataSource_Filter">Filter</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_IsolationLevel" data-uid="C1.Report.DataSource.IsolationLevel">
          <a class="xref" href="C1.Report.DataSource.IsolationLevel.html#C1_Report_DataSource_IsolationLevel">IsolationLevel</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the isolation level for <b>DbTransaction</b>
used to retrieve the report data.</p>
<p>The default is <b>IsolationLevel.ReadCommitted</b>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_MaxRecords" data-uid="C1.Report.DataSource.MaxRecords">
          <a class="xref" href="C1.Report.DataSource.MaxRecords.html#C1_Report_DataSource_MaxRecords">MaxRecords</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the maximum number of data rows to be included in the report (zero includes all rows).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_ParameterPassingMode" data-uid="C1.Report.DataSource.ParameterPassingMode">
          <a class="xref" href="C1.Report.DataSource.ParameterPassingMode.html#C1_Report_DataSource_ParameterPassingMode">ParameterPassingMode</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating how parameter values are passed to the data engine.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_ParentReport" data-uid="C1.Report.DataSource.ParentReport">
          <a class="xref" href="C1.Report.DataSource.ParentReport.html#C1_Report_DataSource_ParentReport">ParentReport</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the report that contains this <a class="xref" href="C1.Report.DataSource.html">DataSource</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_RecordSource" data-uid="C1.Report.DataSource.RecordSource">
          <a class="xref" href="C1.Report.DataSource.RecordSource.html#C1_Report_DataSource_RecordSource">RecordSource</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a string that specifies which table, stored procedure, or Sql command
to use for retrieving the report data.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_RecordSourceType" data-uid="C1.Report.DataSource.RecordSourceType">
          <a class="xref" href="C1.Report.DataSource.RecordSourceType.html#C1_Report_DataSource_RecordSourceType">RecordSourceType</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the type of the <a class="xref" href="C1.Report.DataSource.RecordSource.html#C1_Report_DataSource_RecordSource">RecordSource</a> (stored procedure, table, sql query etc.).</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_Recordset" data-uid="C1.Report.DataSource.Recordset">
          <a class="xref" href="C1.Report.DataSource.Recordset.html#C1_Report_DataSource_Recordset">Recordset</a>
        </td>
        <td class="markdown level1 summary"><p>Sets or gets the data source object that provides data to the report.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_SortDefinitions" data-uid="C1.Report.DataSource.SortDefinitions">
          <a class="xref" href="C1.Report.DataSource.SortDefinitions.html#C1_Report_DataSource_SortDefinitions">SortDefinitions</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the <a class="xref" href="C1.Report.SortDefinitionCollection.html">SortDefinitionCollection</a> collection defining sort of the data source.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Report_DataSource_AssignFrom_C1_Report_DataSource_" data-uid="C1.Report.DataSource.AssignFrom(C1.Report.DataSource)">
          <a class="xref" href="C1.Report.DataSource.AssignFrom.html#C1_Report_DataSource_AssignFrom_C1_Report_DataSource_">AssignFrom(DataSource)</a>
        </td>
        <td class="markdown level1 summary"><p>Assigns (copies) properties from another <a class="xref" href="C1.Report.DataSource.html">DataSource</a> to the current object.
The name of source object is not copied.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_AssignFrom_C1_Report_ReportObject_System_Boolean_" data-uid="C1.Report.DataSource.AssignFrom(C1.Report.ReportObject,System.Boolean)">
          <a class="xref" href="C1.Report.DataSource.AssignFrom.html#C1_Report_DataSource_AssignFrom_C1_Report_ReportObject_System_Boolean_">AssignFrom(ReportObject, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Assigns (copies) properties from another <a class="xref" href="C1.Report.DataSource.html">DataSource</a> to the current object.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_GetPropsTable" data-uid="C1.Report.DataSource.GetPropsTable">
          <a class="xref" href="C1.Report.DataSource.GetPropsTable.html#C1_Report_DataSource_GetPropsTable">GetPropsTable()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_Import_C1_Document_Serialization_XmlNodeWrapperBase_" data-uid="C1.Report.DataSource.Import(C1.Document.Serialization.XmlNodeWrapperBase)">
          <a class="xref" href="C1.Report.DataSource.Import.html#C1_Report_DataSource_Import_C1_Document_Serialization_XmlNodeWrapperBase_">Import(XmlNodeWrapperBase)</a>
        </td>
        <td class="markdown level1 summary"><p>Imports node from legacy xml report definition;</p>
</td>
      </tr>
      <tr>
        <td id="C1_Report_DataSource_ToString" data-uid="C1.Report.DataSource.ToString">
          <a class="xref" href="C1.Report.DataSource.ToString.html#C1_Report_DataSource_ToString">ToString()</a>
        </td>
        <td class="markdown level1 summary"><p>Returns the name of the current data source.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
