TDengine C# Client Library
TDengine.Connector
is the C# language connector provided by TDengine. C# developers can use it to develop C# application software that accesses TDengine cluster data.
Connection types
TDengine.Connector
provides 2 connection types.
- Native connection, which connects to TDengine instances natively through the TDengine client driver (taosc), supporting data writing, querying, subscriptions, schemaless writing, and bind interface.
- Websocket connection which is implemented through taosAdapter. The set of features implemented by the WebSocket connection differs slightly from those implemented by the native connection.(since v3.0.1)
For a detailed introduction of the connection types, please refer to: Establish Connection
Compatibility
TDengine.Connector
version 3.1.0 has been completely refactored and is no longer compatible with 3.0.2 and previous versions. For 3.0.2 documents, please refer to nugetTDengine.Connector
3.x is not compatible with TDengine 2.x. If you need to use the C# connector in an environment running TDengine 2.x version, please use the 1.x version of TDengine.Connector.
Supported platforms
The supported platforms are the same as those supported by the TDengine client driver.
warning
TDengine no longer supports 32-bit Windows platforms.
Version support
Connector version | TDengine version |
---|---|
3.1.0 | 3.2.1.0/3.1.1.18 |
Handling exceptions
TDengine.Connector
will throw an exception and the application needs to handle the exception. The taosc exception type TDengineError
contains error code and error information, and the application can handle it based on the error code and error information.
TDengine DataType vs. C# DataType
TDengine DataType | C# Type |
---|---|
TIMESTAMP | DateTime |
TINYINT | sbyte |
SMALLINT | short |
INT | int |
BIGINT | long |
TINYINT UNSIGNED | byte |
SMALLINT UNSIGNED | ushort |
INT UNSIGNED | uint |
BIGINT UNSIGNED | ulong |
FLOAT | float |
DOUBLE | double |
BOOL | bool |
BINARY | byte[] |
NCHAR | string (utf-8 encoding) |
JSON | byte[] |
Note: JSON type is only supported in tag.