Skip to content

Commit 27d0771

Browse files
committed
address feedback
1 parent 5e343a8 commit 27d0771

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

doc/snippets/Microsoft.Data.SqlClient/SqlDataReader.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@
319319
<summary>Synchronously gets the value of the specified column as a type. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValueAsync``1(System.Int32,System.Threading.CancellationToken)" /> is the asynchronous version of this method.</summary>
320320
<returns>The returned type object.</returns>
321321
<remarks>
322-
<format type="text/markdown"><![CDATA[
322+
<format type="text/markdown">
323+
<![CDATA[
323324
324325
## Remarks
325326
`T` can be one of the following types:
@@ -332,7 +333,8 @@
332333
|SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
333334
|SqlDouble|SqlGuid|SqlInt16|SqlInt32|
334335
|SqlInt64|SqlMoney|SqlSingle|SqlString|
335-
|String|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|||
336+
|Stream|String|TextReader|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|
337+
|XmlReader||||
336338
337339
For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
338340
@@ -359,7 +361,8 @@
359361
<summary>Asynchronously gets the value of the specified column as a type. <see cref="M:Microsoft.Data.SqlClient.SqlDataReader.GetFieldValue``1(System.Int32)" /> is the synchronous version of this method.</summary>
360362
<returns>The returned type object.</returns>
361363
<remarks>
362-
<format type="text/markdown"><![CDATA[
364+
<format type="text/markdown">
365+
<![CDATA[
363366
364367
## Remarks
365368
`T` can be one of the following types:
@@ -372,7 +375,8 @@
372375
|SqlBoolean|SqlByte|SqlDateTime|SqlDecimal|
373376
|SqlDouble|SqlGuid|SqlInt16|SqlInt32|
374377
|SqlInt64|SqlMoney|SqlSingle|SqlString|
375-
|String|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|||
378+
|Stream|String|TextReader|UDT, which can be any CLR type marked with <xref:Microsoft.Data.SqlClient.Server.SqlUserDefinedTypeAttribute>.|
379+
|XmlReader||||
376380
377381
For more information, see [SqlClient Streaming Support](/sql/connect/ado-net/sqlclient-streaming-support).
378382

src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderStreamsTest.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class DataReaderStreamsTest
2020
[MemberData(nameof(GetCommandBehaviours))]
2121
public static async Task GetFieldValueAsync_OfStream(CommandBehavior behavior)
2222
{
23-
const int PacketSize = 512;
23+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
2424
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
2525
byte[] originalData = CreateBinaryData(PacketSize, forcedPacketCount: 4);
2626
string query = CreateBinaryDataQuery(originalData);
@@ -57,7 +57,7 @@ public static async Task GetFieldValueAsync_OfStream(CommandBehavior behavior)
5757
[MemberData(nameof(GetCommandBehaviours))]
5858
public static async Task GetFieldValueAsync_OfXmlReader(CommandBehavior behavior)
5959
{
60-
const int PacketSize = 512;
60+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
6161
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
6262
string originalXml = CreateXmlData(PacketSize, forcedPacketCount: 4);
6363
string query = CreateXmlDataQuery(originalXml);
@@ -92,7 +92,7 @@ public static async Task GetFieldValueAsync_OfXmlReader(CommandBehavior behavior
9292
[MemberData(nameof(GetCommandBehaviours))]
9393
public static async Task GetFieldValueAsync_OfTextReader(CommandBehavior behavior)
9494
{
95-
const int PacketSize = 512;
95+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
9696
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
9797
string originalText = CreateXmlData(PacketSize, forcedPacketCount: 4);
9898
string query = CreateTextDataQuery(originalText);
@@ -127,7 +127,7 @@ public static async Task GetFieldValueAsync_OfTextReader(CommandBehavior behavio
127127
[MemberData(nameof(GetCommandBehaviours))]
128128
public static void GetFieldValue_OfXmlReader(CommandBehavior behavior)
129129
{
130-
const int PacketSize = 512;
130+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
131131
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
132132
string originalXml = CreateXmlData(PacketSize, forcedPacketCount: 4);
133133
string query = CreateXmlDataQuery(originalXml);
@@ -162,7 +162,7 @@ public static void GetFieldValue_OfXmlReader(CommandBehavior behavior)
162162
[MemberData(nameof(GetCommandBehaviours))]
163163
public static void GetFieldValue_OfStream(CommandBehavior behavior)
164164
{
165-
const int PacketSize = 512;
165+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
166166
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
167167
byte[] originalData = CreateBinaryData(PacketSize, forcedPacketCount: 4);
168168
string query = CreateBinaryDataQuery(originalData);
@@ -196,7 +196,7 @@ public static void GetFieldValue_OfStream(CommandBehavior behavior)
196196
[MemberData(nameof(GetCommandBehaviours))]
197197
public static void GetFieldValue_OfTextReader(CommandBehavior behavior)
198198
{
199-
const int PacketSize = 512;
199+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
200200
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
201201
string originalText = CreateXmlData(PacketSize, forcedPacketCount: 4);
202202
string query = CreateTextDataQuery(originalText);
@@ -231,7 +231,7 @@ public static void GetFieldValue_OfTextReader(CommandBehavior behavior)
231231
[MemberData(nameof(GetCommandBehaviours))]
232232
public static void GetStream(CommandBehavior behavior)
233233
{
234-
const int PacketSize = 512;
234+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
235235
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
236236
byte[] originalData = CreateBinaryData(PacketSize, forcedPacketCount: 4);
237237
string query = CreateBinaryDataQuery(originalData);
@@ -268,7 +268,7 @@ public static void GetStream(CommandBehavior behavior)
268268
[MemberData(nameof(GetCommandBehaviours))]
269269
public static void GetXmlReader(CommandBehavior behavior)
270270
{
271-
const int PacketSize = 512;
271+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
272272
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
273273
string originalXml = CreateXmlData(PacketSize, forcedPacketCount: 4);
274274
string query = CreateXmlDataQuery(originalXml);
@@ -303,7 +303,7 @@ public static void GetXmlReader(CommandBehavior behavior)
303303
[MemberData(nameof(GetCommandBehaviours))]
304304
public static void GetTextReader(CommandBehavior behavior)
305305
{
306-
const int PacketSize = 512;
306+
const int PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
307307
string connectionString = SetConnectionStringPacketSize(DataTestUtility.TCPConnectionString, PacketSize);
308308
string originalText = CreateXmlData(PacketSize, forcedPacketCount: 4);
309309
string query = CreateTextDataQuery(originalText);
@@ -494,7 +494,7 @@ private static string SetConnectionStringPacketSize(string connectionString, int
494494
{
495495
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectionString);
496496
builder.PersistSecurityInfo = true;
497-
builder.PacketSize = 512; // force minimun packet size so that the test data spans multiple packets to test sequential access spanning
497+
builder.PacketSize = packetSize;
498498
return builder.ToString();
499499
}
500500

0 commit comments

Comments
 (0)