首先添加 [TDengine.Connector](https://www.nuget.org/packages/TDengine.Connector/) 的引用:
```xml title=csharp.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <StartupObject>TDengineExample.ConnectExample</StartupObject> </PropertyGroup> <ItemGroup> <PackageReference Include="TDengine.Connector" Version="1.0.6" /> </ItemGroup> </Project>
``` ```csharp {{#include docs-examples/csharp/ConnectExample.cs}} ```