_connect_cs_native.mdx 603 字节
Newer Older
1 2
首先添加 [TDengine.Connector](https://www.nuget.org/packages/TDengine.Connector/) 的引用:

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
```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>
19 20 21 22 23
```

```csharp
{{#include docs-examples/csharp/ConnectExample.cs}}
```