# C1.AdoNet.Magento.C1MagentoConnection

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_AdoNet_Magento_C1MagentoConnection" data-uid="C1.AdoNet.Magento.C1MagentoConnection" class="text-break">C1MagentoConnection Class
</h1>
  <div class="markdown level0 summary"><pre><code>&lt;xref href=&quot;C1.AdoNet.Magento.C1MagentoConnection&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; represents a connection to a Magento server. 
</code></pre>
<p>The connection can be used to query the data hosted by the server or request modifications.</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="https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject">MarshalByRefObject</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.component">Component</a></div>
    <div class="level3"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbconnection">DbConnection</a></div>
    <div class="level4"><a class="xref" href="../C1.AdoNet.CSV/C1.DataConnector.AdoNet.C1ConnectionBase.html">C1ConnectionBase</a></div>
    <div class="level5"><a class="xref" href="C1.DataConnector.AdoNet.C1ConnectionBase-1.html">C1ConnectionBase</a>&lt;<a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.html">C1MagentoConnection</a>&gt;</div>
    <div class="level6"><span class="xref">C1MagentoConnection</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.icomponent">IComponent</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.idbconnection">IDbConnection</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iasyncdisposable">IAsyncDisposable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.AdoNet.Magento.html">C1.AdoNet.Magento</a></h6>
  <h6><strong>Assembly</strong>: C1.AdoNet.Magento.dll</h6>
  <h5 id="C1_AdoNet_Magento_C1MagentoConnection_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public sealed class C1MagentoConnection : C1ConnectionBase&lt;C1MagentoConnection&gt;, IComponent, IDbConnection, IDisposable, IAsyncDisposable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public NotInheritable Class C1MagentoConnection
    Inherits C1ConnectionBase(Of C1MagentoConnection)
    Implements IComponent, IDbConnection, IDisposable, IAsyncDisposable</code></pre>
  </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_AdoNet_Magento_C1MagentoConnection__ctor" data-uid="C1.AdoNet.Magento.C1MagentoConnection.#ctor">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.-ctor.html#C1_AdoNet_Magento_C1MagentoConnection__ctor">C1MagentoConnection()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.html">C1MagentoConnection</a> instance.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection__ctor_C1_AdoNet_Magento_C1MagentoConnectionStringBuilder_" data-uid="C1.AdoNet.Magento.C1MagentoConnection.#ctor(C1.AdoNet.Magento.C1MagentoConnectionStringBuilder)">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.-ctor.html#C1_AdoNet_Magento_C1MagentoConnection__ctor_C1_AdoNet_Magento_C1MagentoConnectionStringBuilder_">C1MagentoConnection(C1MagentoConnectionStringBuilder)</a>
        </td>
        <td class="markdown level1 summary"><p>Initialize a new <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.html">C1MagentoConnection</a> instance using the specified connection string
expressed in a <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnectionStringBuilder.html">C1MagentoConnectionStringBuilder</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection__ctor_System_String_" data-uid="C1.AdoNet.Magento.C1MagentoConnection.#ctor(System.String)">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.-ctor.html#C1_AdoNet_Magento_C1MagentoConnection__ctor_System_String_">C1MagentoConnection(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Initialize a new <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.html">C1MagentoConnection</a> instance using the specified connection string.</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_AdoNet_Magento_C1MagentoConnection_AccessToken" data-uid="C1.AdoNet.Magento.C1MagentoConnection.AccessToken">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.AccessToken.html#C1_AdoNet_Magento_C1MagentoConnection_AccessToken">AccessToken</a>
        </td>
        <td class="markdown level1 summary"><p>Access Token.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_ApiVersion" data-uid="C1.AdoNet.Magento.C1MagentoConnection.ApiVersion">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.ApiVersion.html#C1_AdoNet_Magento_C1MagentoConnection_ApiVersion">ApiVersion</a>
        </td>
        <td class="markdown level1 summary"><p>The API version of the Magento server</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_BaseUrl" data-uid="C1.AdoNet.Magento.C1MagentoConnection.BaseUrl">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.BaseUrl.html#C1_AdoNet_Magento_C1MagentoConnection_BaseUrl">BaseUrl</a>
        </td>
        <td class="markdown level1 summary"><p>The base url of the Magento server.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_DataSource" data-uid="C1.AdoNet.Magento.C1MagentoConnection.DataSource">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.DataSource.html#C1_AdoNet_Magento_C1MagentoConnection_DataSource">DataSource</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the name of the database server to which to connect.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_Database" data-uid="C1.AdoNet.Magento.C1MagentoConnection.Database">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.Database.html#C1_AdoNet_Magento_C1MagentoConnection_Database">Database</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the name of the current database after a connection is opened,
or the database name specified in the connection string before the connection is opened.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_ServerVersion" data-uid="C1.AdoNet.Magento.C1MagentoConnection.ServerVersion">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.ServerVersion.html#C1_AdoNet_Magento_C1MagentoConnection_ServerVersion">ServerVersion</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a string that represents the version of the server to which the object is connected.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_TokenType" data-uid="C1.AdoNet.Magento.C1MagentoConnection.TokenType">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.TokenType.html#C1_AdoNet_Magento_C1MagentoConnection_TokenType">TokenType</a>
        </td>
        <td class="markdown level1 summary"><p>The token type to authenticate in Magento.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_UseCache" data-uid="C1.AdoNet.Magento.C1MagentoConnection.UseCache">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.UseCache.html#C1_AdoNet_Magento_C1MagentoConnection_UseCache">UseCache</a>
        </td>
        <td class="markdown level1 summary"><p>Use cache property of the Magento server.</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_AdoNet_Magento_C1MagentoConnection_BeginDbTransaction_System_Data_IsolationLevel_" data-uid="C1.AdoNet.Magento.C1MagentoConnection.BeginDbTransaction(System.Data.IsolationLevel)">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.BeginDbTransaction.html#C1_AdoNet_Magento_C1MagentoConnection_BeginDbTransaction_System_Data_IsolationLevel_">BeginDbTransaction(IsolationLevel)</a>
        </td>
        <td class="markdown level1 summary"><p>Begins a transaction on the connection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_ChangeDatabase_System_String_" data-uid="C1.AdoNet.Magento.C1MagentoConnection.ChangeDatabase(System.String)">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.ChangeDatabase.html#C1_AdoNet_Magento_C1MagentoConnection_ChangeDatabase_System_String_">ChangeDatabase(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Changes the current database for an open connection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_Close" data-uid="C1.AdoNet.Magento.C1MagentoConnection.Close">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.Close.html#C1_AdoNet_Magento_C1MagentoConnection_Close">Close()</a>
        </td>
        <td class="markdown level1 summary"><p>Closes the connection to the database. This is the preferred method of closing any open connection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_CreateDbCommand" data-uid="C1.AdoNet.Magento.C1MagentoConnection.CreateDbCommand">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.CreateDbCommand.html#C1_AdoNet_Magento_C1MagentoConnection_CreateDbCommand">CreateDbCommand()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates and returns a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.data.common.dbcommand">DbCommand</a> object associated with the current connection.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_GetColumnsSchema_System_String___" data-uid="C1.AdoNet.Magento.C1MagentoConnection.GetColumnsSchema(System.String[])">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.GetColumnsSchema.html#C1_AdoNet_Magento_C1MagentoConnection_GetColumnsSchema_System_String___">GetColumnsSchema(string[])</a>
        </td>
        <td class="markdown level1 summary"><p>Retrieve the metadata relatively to the columns.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_GetPrimaryKeySchema_System_String___" data-uid="C1.AdoNet.Magento.C1MagentoConnection.GetPrimaryKeySchema(System.String[])">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.GetPrimaryKeySchema.html#C1_AdoNet_Magento_C1MagentoConnection_GetPrimaryKeySchema_System_String___">GetPrimaryKeySchema(string[])</a>
        </td>
        <td class="markdown level1 summary"><p>Retrieve the metadata relatively to the primary keys.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_GetTablesSchema_System_String___" data-uid="C1.AdoNet.Magento.C1MagentoConnection.GetTablesSchema(System.String[])">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.GetTablesSchema.html#C1_AdoNet_Magento_C1MagentoConnection_GetTablesSchema_System_String___">GetTablesSchema(string[])</a>
        </td>
        <td class="markdown level1 summary"><p>Retrieve the metadata relatively to the tables.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_OnConnectionStringChanged" data-uid="C1.AdoNet.Magento.C1MagentoConnection.OnConnectionStringChanged">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.OnConnectionStringChanged.html#C1_AdoNet_Magento_C1MagentoConnection_OnConnectionStringChanged">OnConnectionStringChanged()</a>
        </td>
        <td class="markdown level1 summary"><p>A method that is executed everytime that the connection string used by this <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnectionStringBuilder.html">C1MagentoConnectionStringBuilder</a> has changed.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_Open" data-uid="C1.AdoNet.Magento.C1MagentoConnection.Open">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.Open.html#C1_AdoNet_Magento_C1MagentoConnection_Open">Open()</a>
        </td>
        <td class="markdown level1 summary"><p>Opens a database connection with the settings specified by the connection string.</p>
</td>
      </tr>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_OpenAsync_System_Threading_CancellationToken_" data-uid="C1.AdoNet.Magento.C1MagentoConnection.OpenAsync(System.Threading.CancellationToken)">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.OpenAsync.html#C1_AdoNet_Magento_C1MagentoConnection_OpenAsync_System_Threading_CancellationToken_">OpenAsync(CancellationToken)</a>
        </td>
        <td class="markdown level1 summary"><p>An asynchronous version of <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.Open.html#C1_AdoNet_Magento_C1MagentoConnection_Open">Open()</a> open.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_AdoNet_Magento_C1MagentoConnection_OAuthTokenRetreived" data-uid="C1.AdoNet.Magento.C1MagentoConnection.OAuthTokenRetreived">
          <a class="xref" href="C1.AdoNet.Magento.C1MagentoConnection.OAuthTokenRetreived.html">OAuthTokenRetreived</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs after the token is taken.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
