> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> The official C# clients for connecting to ClickHouse over HTTP or native TCP.

# ClickHouse C# clients

The official C# clients connect to ClickHouse over either HTTP or the native TCP protocol.
Both clients ship in the `ClickHouse.Driver` NuGet package.

<h2 id="http">
  HTTP
</h2>

The HTTP client provides the high-level, thread-safe `ClickHouseClient` API and the ADO.NET API
used by ORMs. It targets .NET 6.0 and newer and is recommended for most applications.

Use the HTTP client when you need:

* ADO.NET or an ORM;
* CSV, JSONEachRow, Parquet, or raw stream input and output;
* bearer authentication or custom HTTP headers;
* custom parameter type resolution, parameter formatting, or read conversion;
* a per-query database or role;
* better `JSON` performance. The TCP client can transfer `JSON` values only as text.

[Read the HTTP client documentation](./http).

<h2 id="native-tcp">
  Native TCP
</h2>

The native TCP client is experimental, and its public API may change in a future release. It provides
the `ClickHouseTcpClient` API for columnar block reads, native compression, pooled connections, and
pinned sessions. It targets .NET 8.0 and newer.

Use the native TCP client when you need:

* better performance, especially when processing data in columns;
* columnar data blocks;
* persistent connections;
* pinned sessions through `OpenSessionAsync`;
* progress, profile, log, totals, and extremes callbacks;
* W3C trace context propagation to ClickHouse.

[Read the native TCP client documentation](./tcp).
