# C1.Report.DataSource.ConnectionString

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Report_DataSource_ConnectionString_" data-uid="C1.Report.DataSource.ConnectionString*">ConnectionString Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Report_DataSource_ConnectionString_" data-uid="C1.Report.DataSource.ConnectionString*"></a>
<h4 id="C1_Report_DataSource_ConnectionString" data-uid="C1.Report.DataSource.ConnectionString">ConnectionString</h4>
<div class="markdown level1 summary"><p>Gets or sets the connection string used to open a database.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[Browsable(false)]
[C1Category(&quot;Data&quot;)]
[C1Description(&quot;DataSource.ConnectionString&quot;, &quot;The connection string used to open a database.&quot;)]
public string ConnectionString { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;Browsable(False)&gt;
&lt;C1Category(&quot;Data&quot;)&gt;
&lt;C1Description(&quot;DataSource.ConnectionString&quot;, &quot;The connection string used to open a database.&quot;)&gt;
Public Property ConnectionString As String</code></pre>
</div>
<h5 id="C1_Report_DataSource_ConnectionString_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>This property is used by the <a class="xref" href="C1.Report.DataSource.html">DataSource</a> class to load the report data.</p>
<p>While ConnectionString specifies the database that contains the data,
<a class="xref" href="C1.Report.DataSource.RecordSource.html#C1_Report_DataSource_RecordSource">RecordSource</a> specifies which table, stored procedure, or Sql command to use for 
retrieving the data.</p>
<p>
The syntax of ConnectionString is determined by the type of the data provider used by
<a class="xref" href="C1.Report.DataSource.html">DataSource</a>.
For example if DataProvider is <a class="xref" href="C1.Report.DataProvider.html#C1_Report_DataProvider_OLEDB">OLEDB</a> then
ConnectionString should use syntax used in <b>OleDbConnection</b>,
if DataProvider is <a class="xref" href="C1.Report.DataProvider.html#C1_Report_DataProvider_XmlFile">XmlFile</a>, it should contain the name of the XML file,
and so on.
</p>
<p>If you want to use a different type of connection (e.g. System.Data.SqlClient.SqlConnection,
or if your application already has the data available in a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.datatable">DataTable</a> object, you can assign the data 
directly to the <a class="xref" href="C1.Report.DataSource.Recordset.html#C1_Report_DataSource_Recordset">Recordset</a> property.</p>
</div>
</div>
