From 895c936938112cc7a395316cca377a9036996afb Mon Sep 17 00:00:00 2001 From: xiaolei li <85657333+xleili@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:17:14 +0800 Subject: [PATCH] =?UTF-8?q?docs(driver):update=20C#=20example=20and=20cont?= =?UTF-8?q?ent=20about=20WebSocket=20to=20include=E2=80=A6=20(#17513)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(driver):update C# example and content about WebSocket to include dll from nupkg * fix: typos Co-authored-by: Shuduo Sang --- docs/en/07-data-in/01-insert-data.md | 6 ++- docs/en/09-data-out/01-query-data.md | 4 ++ .../en/15-programming/01-connect/06-csharp.md | 19 +++++++- .../15-programming/06-connector/06-csharp.md | 47 ++----------------- .../cloud-example/connect/connect.csproj | 8 +++- .../csharp/cloud-example/inout/inout.csproj | 8 +++- .../csharp/cloud-example/stmt/stmt.csproj | 11 +++-- .../csharp/cloud-example/usage/usage.csproj | 10 +++- 8 files changed, 62 insertions(+), 51 deletions(-) diff --git a/docs/en/07-data-in/01-insert-data.md b/docs/en/07-data-in/01-insert-data.md index b8396632fc..db55a2bd4d 100644 --- a/docs/en/07-data-in/01-insert-data.md +++ b/docs/en/07-data-in/01-insert-data.md @@ -89,7 +89,11 @@ In this example, we use `exec` method to execute SQL. `exec` is designed for som -```C# +``` XML +{{#include docs/examples/csharp/cloud-example/inout/inout.csproj}} +``` + +```csharp {{#include docs/examples/csharp/cloud-example/inout/Program.cs:insert}} ``` diff --git a/docs/en/09-data-out/01-query-data.md b/docs/en/09-data-out/01-query-data.md index 2ac5614b76..3810b705aa 100644 --- a/docs/en/09-data-out/01-query-data.md +++ b/docs/en/09-data-out/01-query-data.md @@ -231,6 +231,10 @@ Get all rows and print each row: In this example, we use query method to execute SQL and get a result object. +``` XML +{{#include docs/examples/csharp/cloud-example/inout/inout.csproj}} +``` + ```C# {{#include docs/examples/csharp/cloud-example/inout/Program.cs:query}} ``` diff --git a/docs/en/15-programming/01-connect/06-csharp.md b/docs/en/15-programming/01-connect/06-csharp.md index 1c67a345b1..5907e3a9f0 100644 --- a/docs/en/15-programming/01-connect/06-csharp.md +++ b/docs/en/15-programming/01-connect/06-csharp.md @@ -18,7 +18,21 @@ dotnet new console -o example ```bash cd example -dotnet add package TDengine.Connector +vim example.csproj +``` + +Add following ItemGroup and Task to your project file. + +```XML + + + + + + + + + ``` ## Config @@ -59,6 +73,9 @@ Replace with real TDengine cloud DSN. To obtain the real value, please l ## Connect +``` XML +{{#include docs/examples/csharp/cloud-example/connect/connect.csproj}} +``` ```C# {{#include docs/examples/csharp/cloud-example/connect/Program.cs}} diff --git a/docs/en/15-programming/06-connector/06-csharp.md b/docs/en/15-programming/06-connector/06-csharp.md index b745a9c970..1d205f690f 100644 --- a/docs/en/15-programming/06-connector/06-csharp.md +++ b/docs/en/15-programming/06-connector/06-csharp.md @@ -23,19 +23,7 @@ dotnet add package TDengine.Connector ## Establishing a connection ``` XML - - - - Exe - net5.0 - enable - - - - - - - +{{#include docs/examples/csharp/cloud-example/connect/connect.csproj}} ``` ``` C# @@ -47,20 +35,7 @@ dotnet add package TDengine.Connector ### Basic Insert and Query ``` XML - - - - Exe - net5.0 - enable - - - - - - - - +{{#include docs/examples/csharp/cloud-example/usage/usage.csproj}} ``` ```C# @@ -70,20 +45,7 @@ dotnet add package TDengine.Connector ### STMT Insert ``` XML - - - - Exe - net5 - enable - - - - - - - - +{{#include docs/examples/csharp/cloud-example/stmt/stmt.csproj}} ``` ```C# @@ -94,7 +56,8 @@ dotnet add package TDengine.Connector | TDengine.Connector | Description | | ------------------------- | ---------------------------------------------------------------- | -| 3.0.1 | Support connect to TDengine cloud service +| 3.0.2 | Support .NET Framework 4.5 and above. Support .Net standard 2.0. Nuget package includes dynamic library for WebSocket.| +| 3.0.1 | Support connect to TDengine cloud service| ## API Reference diff --git a/docs/examples/csharp/cloud-example/connect/connect.csproj b/docs/examples/csharp/cloud-example/connect/connect.csproj index 2a4903745b..214538f4e1 100644 --- a/docs/examples/csharp/cloud-example/connect/connect.csproj +++ b/docs/examples/csharp/cloud-example/connect/connect.csproj @@ -7,7 +7,13 @@ - + + + + + + + diff --git a/docs/examples/csharp/cloud-example/inout/inout.csproj b/docs/examples/csharp/cloud-example/inout/inout.csproj index 34951dc761..fbcfb9213b 100644 --- a/docs/examples/csharp/cloud-example/inout/inout.csproj +++ b/docs/examples/csharp/cloud-example/inout/inout.csproj @@ -7,7 +7,13 @@ - + + + + + + + diff --git a/docs/examples/csharp/cloud-example/stmt/stmt.csproj b/docs/examples/csharp/cloud-example/stmt/stmt.csproj index 4a7c03f79c..bfdb3c2bb1 100644 --- a/docs/examples/csharp/cloud-example/stmt/stmt.csproj +++ b/docs/examples/csharp/cloud-example/stmt/stmt.csproj @@ -6,8 +6,13 @@ enable - - + + - + + + + + + diff --git a/docs/examples/csharp/cloud-example/usage/usage.csproj b/docs/examples/csharp/cloud-example/usage/usage.csproj index 757d36dc10..214538f4e1 100644 --- a/docs/examples/csharp/cloud-example/usage/usage.csproj +++ b/docs/examples/csharp/cloud-example/usage/usage.csproj @@ -6,8 +6,14 @@ enable - - + + + + + + + + -- GitLab