<Type Name="SqlConnection" FullName="System.Data.SqlClient.SqlConnection">
  <TypeSignature Language="C#" Value="public sealed class SqlConnection : System.ComponentModel.Component, IComponent, IDisposable, IDbConnection, ICloneable" Maintainer="auto" />
  <AssemblyInfo>
    <AssemblyName>System.Data</AssemblyName>
    <AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey>
    <AssemblyVersion>1.0.3300.0</AssemblyVersion>
    <AssemblyCulture>neutral</AssemblyCulture>
    <Attributes>
      <Attribute>
        <AttributeName>System.CLSCompliantAttribute</AttributeName>
      </Attribute>
      <Attribute>
        <AttributeName>System.Runtime.InteropServices.ComVisibleAttribute</AttributeName>
      </Attribute>
      <Attribute>
        <AttributeName>System.Resources.NeutralResourcesLanguageAttribute</AttributeName>
      </Attribute>
      <Attribute>
        <AttributeName>System.Security.AllowPartiallyTrustedCallersAttribute</AttributeName>
      </Attribute>
      <Attribute>
        <AttributeName>System.Resources.SatelliteContractVersionAttribute</AttributeName>
      </Attribute>
    </Attributes>
  </AssemblyInfo>
  <ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement>
  <Docs>
    <summary>The SqlConnection class represents a SQL Server connection.</summary>
    <remarks>When a previously opened SQLConnection goes out of scope, the database connection is not automatically closed. Connections that have been opened must be explicitly closed by calling either Close or Dispose.</remarks>
  </Docs>
  <Base>
    <BaseTypeName>System.ComponentModel.Component</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>System.ComponentModel.IComponent</InterfaceName>
    </Interface>
    <Interface>
      <InterfaceName>System.IDisposable</InterfaceName>
    </Interface>
    <Interface>
      <InterfaceName>System.Data.IDbConnection</InterfaceName>
    </Interface>
    <Interface>
      <InterfaceName>System.ICloneable</InterfaceName>
    </Interface>
  </Interfaces>
  <Attributes>
    <Attribute>
      <AttributeName>System.ComponentModel.DefaultEventAttribute</AttributeName>
    </Attribute>
  </Attributes>
  <Members>
    <Member MemberName="Open">
      <MemberSignature Language="C#" Value="public virtual void Open ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Opens a connection to a SQL Server database.</summary>
        <remarks>
          <para>This method opens a new connection (or obtains an existing one from the connection pool) to a SQL Server database using a previously provided connection string.</para>
          <para>A SqlException will be thrown if the connection is closed and any commands are executed against the SQL server.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="ChangeDatabase">
      <MemberSignature Language="C#" Value="public virtual void ChangeDatabase (string database);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="database" Type="System.String" />
      </Parameters>
      <Docs>
        <summary>Change the database currently associated with the <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.</summary>
        <param name="database">The name of an existing database to associate the <see cref="T:System.Data.SqlClient.SqlConnection" /> instance with.</param>
        <remarks>Change the database currently associated with the <see cref="T:System.Data.SqlClient.SqlConnection" /> instance. The SqlConnection instance must already be connected to a SQL Server database.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Close">
      <MemberSignature Language="C#" Value="public virtual void Close ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Close an open database connection.</summary>
        <remarks>Calling this method closes a connection to a SQL Server or releases the connection back to the connection pool. The <see cref="T:System.Data.SqlClient.SqlConnection" /> state is set to closed.
<para>
Calling Close on a <see cref="T:System.Data.SqlClient.SqlConnection" /> instance that is not currently open is acceptable; no exception is raised.
</para><para>
If there are any pending transactions, they will be rolled back.
</para></remarks>
      </Docs>
    </Member>
    <Member MemberName="Dispose">
      <MemberSignature Language="C#" Value="protected virtual void Dispose (bool disposing);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="disposing" Type="System.Boolean" />
      </Parameters>
      <Docs>
        <summary>Disposes the current <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.</summary>
        <param name="disposing">To be added: an object of type 'bool'</param>
        <remarks>
          <para>
Disposes the current <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.
</para>
          <para>
Disposing this class will close the current connection, if one is active.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="BeginTransaction">
      <MemberSignature Language="C#" Value="public SqlTransaction BeginTransaction ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.SqlClient.SqlTransaction</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Begins a new database transaction.</summary>
        <returns>A new instance of the <see cref="T:System.Data.SqlClient.SqlTransaction" /> class that references the current <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.</returns>
        <remarks>
          <para>
Creates and initializes a new <see cref="T:System.Data.SqlClient.SqlTransaction" /> instance associated with the current <see cref="T:System.Data.SqlClient.SqlConnection" />. 
</para>
          <para>The new transaction is created with a default <see cref="T:System.Data.IsolationLevel" /> of <see cref="F:System.Data.IsolationLevel.ReadCommitted" /> and an empty transaction name.</para>
          <para>The <see cref="T:System.Data.SqlClient.SqlConnection" /> class only supports a single transaction. The creation of more will raise an InvalidOperationException exception.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="BeginTransaction">
      <MemberSignature Language="C#" Value="public SqlTransaction BeginTransaction (Data.IsolationLevel iso);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.SqlClient.SqlTransaction</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="iso" Type="System.Data.IsolationLevel" />
      </Parameters>
      <Docs>
        <summary>Begins a new database transaction with a specified <see cref="T:System.Data.IsolationLevel" />.</summary>
        <param name="iso">An <see cref="T:System.Data.IsolationLevel" /> to initialize the transaction with.</param>
        <returns>A new instance of the <see cref="T:System.Data.SqlClient.SqlTransaction" /> class that references the current <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.</returns>
        <remarks>
          <para>
Creates and initializes a new <see cref="T:System.Data.SqlClient.SqlTransaction" /> instance associated with the current <see cref="T:System.Data.SqlClient.SqlConnection" />. 
</para>
          <para>The new transaction is created with an <see cref="T:System.Data.IsolationLevel" /> of the desired isolation level and an empty transaction name.</para>
          <para>The <see cref="T:System.Data.SqlClient.SqlConnection" /> class only supports a single transaction. The creation of more will raise an InvalidOperationException exception.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="BeginTransaction">
      <MemberSignature Language="C#" Value="public SqlTransaction BeginTransaction (string transactionName);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.SqlClient.SqlTransaction</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="transactionName" Type="System.String" />
      </Parameters>
      <Docs>
        <summary>Begins a new database transaction with a specified transaction name.</summary>
        <param name="transactionName">A <see cref="T:System.String" /> value representing the desired transaction name.</param>
        <returns>A new instance of the <see cref="T:System.Data.SqlClient.SqlTransaction" /> class that references the current <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.</returns>
        <remarks>
          <para>
Creates and initializes a new <see cref="T:System.Data.SqlClient.SqlTransaction" /> instance associated with the current <see cref="T:System.Data.SqlClient.SqlConnection" />. 
</para>
          <para>The new transaction is created with a default <see cref="T:System.Data.IsolationLevel" /> of <see cref="F:System.Data.IsolationLevel.ReadCommitted" /> and a transaction name value provided by the transactionName parameter.</para>
          <para>The <see cref="T:System.Data.SqlClient.SqlConnection" /> class only supports a single transaction. The creation of more will raise an InvalidOperationException exception.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="BeginTransaction">
      <MemberSignature Language="C#" Value="public SqlTransaction BeginTransaction (Data.IsolationLevel iso, string transactionName);" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.SqlClient.SqlTransaction</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="iso" Type="System.Data.IsolationLevel" />
        <Parameter Name="transactionName" Type="System.String" />
      </Parameters>
      <Docs>
        <summary>Begins a new database transaction with a specified <see cref="T:System.Data.IsolationLevel" /> and transaction name.</summary>
        <param name="iso">An <see cref="T:System.Data.IsolationLevel" /> to initialize the transaction with.</param>
        <param name="transactionName">A <see cref="T:System.String" /> value representing the desired transaction name.</param>
        <returns>A new instance of the <see cref="T:System.Data.SqlClient.SqlTransaction" /> class that references the current <see cref="T:System.Data.SqlClient.SqlConnection" /> instance.</returns>
        <remarks>
          <para>
Creates and initializes a new <see cref="T:System.Data.SqlClient.SqlTransaction" /> instance associated with the current <see cref="T:System.Data.SqlClient.SqlConnection" />. 
</para>
          <para>The new transaction is created using the provided <see cref="T:System.Data.IsolationLevel" /> and transaction name.</para>
          <para>The <see cref="T:System.Data.SqlClient.SqlConnection" /> class only supports a single transaction. The creation of more will raise an InvalidOperationException exception.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="CreateCommand">
      <MemberSignature Language="C#" Value="public SqlCommand CreateCommand ();" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.SqlClient.SqlCommand</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Creates a new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class with the connection referencing the current <see cref="T:System.Data.SqlClient.SqlCommand" /> instance.</summary>
        <returns>A new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class.</returns>
        <remarks>
          <para>Creates a new instance of the <see cref="T:System.Data.SqlClient.SqlCommand" /> class with the connection referencing the current <see cref="T:System.Data.SqlClient.SqlCommand" /> instance.</para>
          <para>The returned <see cref="T:System.Data.SqlClient.SqlCommand" /> instance can be used to execute T-SQL statements or stored procedures against the current database connection.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public SqlConnection ();" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters />
      <Docs>
        <summary>Initializes a new instance of the SqlConnection class.</summary>
        <returns>A new, unconnected instance of the <see cref="T:System.Data.SqlClient.SqlConnection" /> class.</returns>
        <remarks>To be added</remarks>
      </Docs>
    </Member>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public SqlConnection (string connectionString);" />
      <MemberType>Constructor</MemberType>
      <ReturnValue />
      <Parameters>
        <Parameter Name="connectionString" Type="System.String" />
      </Parameters>
      <Docs>
        <summary>Initializes a new instance of the SqlConnection class with a connection string.</summary>
        <param name="connectionString">
          <para>A <see cref="T:System.String" /> value consisting of the desired database connection string.
</para>
          <para>See <see cref="P:System.Data.SqlClient.SqlConnection.ConnectionString" /> for more information.
</para>
        </param>
        <returns>A new, unconnected instance of the <see cref="T:System.Data.SqlClient.SqlConnection" /> class initialized with a provided connection string.</returns>
        <remarks>Providing a connection string to the SQLConnection constructor does not implicitly open a connection to a database.</remarks>
      </Docs>
    </Member>
    <Member MemberName="ConnectionString">
      <MemberSignature Language="C#" Value="public virtual string ConnectionString { set; get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Parameters>
      </Parameters>
      <Docs>
        <summary>Gets or sets the database Connection String associated with the SqlConnection instance.</summary>
        <param name="value">A <see cref="T:System.String" /> value describing the desired database connection.</param>
        <returns>The current connection string.</returns>
        <remarks>
          <para>
The Connection String is a <see cref="T:System.String" /> value that describes how to connect to a SQL Server instance. The Connection String is composed of a series of name/value pairs connected by equal signs and separated by semicolons.
</para>
          <para>
The SQL Server Connection String should consist of at least the following:
<list type="bullet"><item><term>Data Source or Server</term></item><item><term>Database or Initial Catalog</term></item></list></para>
          <para>
The following illustrates a simple SQL Server Connection String that describes a connection to a database called pubs on the local machine as a user called username with a password of mypassword:
<example><code lang="SQL Server Connection String">
	"Server=localhost;Database=pubs;Uid=username;Password=mypassword"
  </code></example></para>
          <block subset="none" type="note">The Connection String can not be set when a connection to a database is already open.</block>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="ConnectionTimeout">
      <MemberSignature Language="C#" Value="public virtual int ConnectionTimeout { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the amount of time the <see cref="T:System.Data.SqlClient.SqlConnection" /> will wait while attempting to connect to a SQL Server instance.</summary>
        <returns>The amount of time (in seconds) the SqlConnection will wait when attempting to connect.</returns>
        <remarks>
          <para>The connection timeout is a <see cref="T:System.Integer" /> value indicating the amount of time, in seconds, the SqlConnection will wait while attempting to connect to a SQL Server instance.
</para>
          <para>The default timeout is 15 seconds.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Database">
      <MemberSignature Language="C#" Value="public virtual string Database { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the name of the database the <see cref="T:System.Data.SqlClient.SqlConnection" /> instance references.</summary>
        <returns>Gets a <see cref="T:System.String" /> value representing the current SQL Server database.</returns>
        <remarks>Gets the name of the current database an open <see cref="T:System.Data.SqlClient.SqlConnection" /> is currently connected to.

<para>
The <see cref="P:System.Data.SqlClient.SqlConnection.Database" /> is set in the Connection String by supplying either a "database" or "initial catalog" value.
</para><block subset="none" type="note">The Database property can only be set when the <see cref="T:System.Data.SqlClient.SqlConnection" /> has an open connection to a SQL Server.</block></remarks>
      </Docs>
    </Member>
    <Member MemberName="DataSource">
      <MemberSignature Language="C#" Value="public string DataSource { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the current SQL Server that the <see cref="T:System.Data.SqlClient.SqlConnection" /> references.</summary>
        <returns>Gets a <see cref="T:System.String" /> value representing the current SQL Server instance.</returns>
        <remarks>
          <para>
Gets the current DataSource the <see cref="T:System.Data.SqlClient.SqlConnection" /> instance references. The DataSource is the SQL Server network address and (optionally) data port.
</para>
          <para>
The <see cref="P:System.Data.SqlClient.SqlConnection.DataSource" /> can be set in the Connection String by denoting it with one of the following key names: "data source", "server", "address", "addr", or "network address".
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="PacketSize">
      <MemberSignature Language="C#" Value="public int PacketSize { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the packet size used to communicate with a SQL Server.</summary>
        <returns>The packet size, in bytes.</returns>
        <remarks>
          <para>Gets the packet size used to communicate with a SQL Server over a network.
</para>
          <para>
The <see cref="P:System.Data.SqlClient.SqlConnection.PacketSize" /> can be set by appending the "packet size" value to the Connection String.
</para>
          <para>
            <block subset="none" type="note">The default packet size is 8192 bytes.
</block>
          </para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="WorkstationId">
      <MemberSignature Language="C#" Value="public string WorkstationId { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the database connection client workstation ID.</summary>
        <returns>A <see cref="T:System.String" /> value representing the connection's network client.</returns>
        <remarks>
          <para>Returns an ID that represents the database connection's network client.</para>
          <para>
            <see cref="P:System.Data.SqlClient.SqlConnection.Workstationid" /> can be set by appending a "workstatation id" value to the Connection String.
</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="ServerVersion">
      <MemberSignature Language="C#" Value="public string ServerVersion { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.String</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the version of a SQL Server instance.</summary>
        <returns>A <see cref="T:System.String" /> value representing the version of the currently connected SQL Server instance.</returns>
        <remarks>Gets the version of the SQL Server instance the <see cref="T:System.Data.SqlClient.SqlConnection" /> is currently connected to.</remarks>
      </Docs>
    </Member>
    <Member MemberName="State">
      <MemberSignature Language="C#" Value="public virtual Data.ConnectionState State { get; };" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.ConnectionState</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets the current connection state.</summary>
        <returns>The current connection state, represented by an instance of the <see cref="T:System.Data.ConnectionState" /> enum.</returns>
        <remarks>Gets the current connection state on the <see cref="T:System.Data.SqlClient.SqlConnection" /> instance. This value indicates whether the connection is open or closed.</remarks>
      </Docs>
    </Member>
    <Member MemberName="InfoMessage">
      <MemberSignature Language="C#" Value="public event SqlInfoMessageEventHandler InfoMessage;" />
      <MemberType>Event</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.SqlClient.SqlInfoMessageEventHandler</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>To be added</summary>
        <remarks>To be added</remarks>
      </Docs>
    </Member>
    <Member MemberName="StateChange">
      <MemberSignature Language="C#" Value="public event Data.StateChangeEventHandler StateChange;" />
      <MemberType>Event</MemberType>
      <ReturnValue>
        <ReturnType>System.Data.StateChangeEventHandler</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>
        <summary>Event that is triggered when the connection's status changes.</summary>
        <remarks>This event is triggered when the <see cref="T:System.Data.SqlClient.SqlConnection" /> connection status changes to open or closed.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>