Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 07643a0

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/sql-docs-pr into release-2019-cu
2 parents e94dfb4 + 982a0e4 commit 07643a0

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

docs/ado/guide/data/hellodata-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ author: rothja
1515
ms.author: jroth
1616
---
1717
# HelloData Code
18-
```
18+
```vb
1919
'BeginHelloData
2020
Option Explicit
2121

docs/connect/ado-net/enable-eventsource-tracing.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,14 @@ The following example enables event tracing for a data operation on the **Advent
5151

5252
## Event tracing support in Native SNI
5353

54-
**Microsoft.Data.SqlClient** v2.1.0 extends event tracing support in **Microsoft.Data.SqlClient.SNI** and **Microsoft.Data.SqlClient.SNI.runtime**. By sending an EventCommand to `SqlClientEventSource`, events in native SNI.dll can be collected using [Xperf](/windows-hardware/test/wpt/) and [PerfView](https://github.com/microsoft/perfview) tools. The valid EventCommand values are listed as below:
54+
**Microsoft.Data.SqlClient** provides event tracing support in **Microsoft.Data.SqlClient.SNI** and **Microsoft.Data.SqlClient.SNI.runtime** starting with v2.1. Events can be collected from the native DLLs using [Xperf](/windows-hardware/test/wpt/) and [PerfView](https://github.com/microsoft/perfview) tools.
55+
56+
Starting with **Microsoft.Data.SqlClient** v3.0, event tracing can be enabled without any modifications in the client application using event collection tools.
57+
58+
With **Microsoft.Data.SqlClient** v2.1, event tracing needs to be enabled by configuring `EventCommand` with event source listener. The valid `EventCommand` values applicable to Native SNI are listed as below:
5559

5660
```cs
61+
5762
// Enables trace events:
5863
EventSource.SendCommand(eventSource, (EventCommand)8192, null);
5964

@@ -64,11 +69,11 @@ EventSource.SendCommand(eventSource, (EventCommand)16384, null);
6469
EventSource.SendCommand(eventSource, (EventCommand)(8192 | 16384), null);
6570
```
6671

67-
The following example enables event tracing in native SNI.dll when the application targets .NET Framework.
72+
73+
The following example enables event tracing in native SNI DLLs.
6874

6975
```cs
7076
// Native SNI tracing example
71-
// .NET Framework application
7277
using System;
7378
using System.Diagnostics.Tracing;
7479
using Microsoft.Data.SqlClient;
@@ -91,6 +96,7 @@ class Program
9196

9297
static void Main(string[] args)
9398
{
99+
// Event source listener configuration is not required in v3.0 onwards.
94100
using (SqlClientListener listener = new SqlClientListener())
95101
using (SqlConnection connection = new SqlConnection(connectionString))
96102
{

0 commit comments

Comments
 (0)