Skip to content

Commit 16f56af

Browse files
authored
Improvements around DBNull.Value for DataRowExtensions (dotnet#9080)
Closes dotnet#9077
1 parent 107aa62 commit 16f56af

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

xml/System.Data/DataRowExtensions.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@
107107
<format type="text/markdown"><![CDATA[
108108
109109
## Remarks
110-
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> does not support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value>, the returned nullable type will have a value of **null**.
110+
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> and <xref:System.Data.DataTable> do not support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value?displayProperty=nameWithType>, the returned nullable type will have a value of **null**.
111111
112-
If the value of the specified <xref:System.Data.DataColumn> is <xref:System.DBNull.Value> and `T` is a reference type or nullable type, the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value>.
112+
If the value of the specified <xref:System.Data.DataColumn> is <xref:System.DBNull.Value?displayProperty=nameWithType> and `T` is a reference type or nullable type, the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value?displayProperty=nameWithType>.
113113
114114
The <xref:System.Data.DataRowExtensions.Field%2A> method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the <xref:System.Data.DataRowExtensions.Field%2A> method. The column value should then be converted to another type.
115115
@@ -167,9 +167,9 @@
167167
<format type="text/markdown"><![CDATA[
168168
169169
## Remarks
170-
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value>, the returned nullable type will have a value of **null**.
170+
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value?displayProperty=nameWithType>, the returned nullable type will have a value of **null**.
171171
172-
If the value of the specified <xref:System.Data.DataColumn> is **null** and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value>.
172+
If the value of the specified <xref:System.Data.DataColumn> is **null** and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value?displayProperty=nameWithType>.
173173
174174
The <xref:System.Data.DataRowExtensions.Field%2A> method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the <xref:System.Data.DataRowExtensions.Field%2A> method. The column value should then be converted to another type.
175175
@@ -227,9 +227,9 @@
227227
<format type="text/markdown"><![CDATA[
228228
229229
## Remarks
230-
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> does not support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value>, the returned nullable type will have a value of **null**.
230+
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> and <xref:System.Data.DataTable> do not support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value?displayProperty=nameWithType>, the returned nullable type will have a value of **null**.
231231
232-
If the value of the specified <xref:System.Data.DataColumn> is **null** and `T` is a reference type or nullable type, the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value>.
232+
If the value of the specified <xref:System.Data.DataColumn> is **null** and `T` is a reference type or nullable type, the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value?displayProperty=nameWithType>.
233233
234234
The <xref:System.Data.DataRowExtensions.Field%2A> method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the <xref:System.Data.DataRowExtensions.Field%2A> method. The column value should then be converted to another type.
235235
@@ -289,9 +289,9 @@
289289
<format type="text/markdown"><![CDATA[
290290
291291
## Remarks
292-
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value>, the returned nullable type will have a value of **null**.
292+
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value?displayProperty=nameWithType>, the returned nullable type will have a value of **null**.
293293
294-
If the value of the specified <xref:System.Data.DataColumn> is null and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value>.
294+
If the value of the specified <xref:System.Data.DataColumn> is null and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value?displayProperty=nameWithType>.
295295
296296
The <xref:System.Data.DataRowExtensions.Field%2A> method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the <xref:System.Data.DataRowExtensions.Field%2A> method. The column value should then be converted to another type.
297297
@@ -351,9 +351,9 @@
351351
<format type="text/markdown"><![CDATA[
352352
353353
## Remarks
354-
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value>, the returned nullable type will have a value of **null**.
354+
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value?displayProperty=nameWithType>, the returned nullable type will have a value of **null**.
355355
356-
If the value of the specified <xref:System.Data.DataColumn> is null and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value>.
356+
If the value of the specified <xref:System.Data.DataColumn> is null and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value?displayProperty=nameWithType>.
357357
358358
The <xref:System.Data.DataRowExtensions.Field%2A> method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the <xref:System.Data.DataRowExtensions.Field%2A> method. The column value should then be converted to another type.
359359
@@ -413,9 +413,9 @@
413413
<format type="text/markdown"><![CDATA[
414414
415415
## Remarks
416-
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value>, the returned nullable type will have a value of **null**.
416+
The <xref:System.Data.DataSet> class represents **null** values with the <xref:System.DBNull.Value> instance of the <xref:System.DBNull> class. A Language-Integrated Query (LINQ) expression that accessed a column with a **null** value would generate a <xref:System.InvalidCastException> at run time. Additionally, <xref:System.Data.DataSet> doesn't support nullable types. The <xref:System.Data.DataRowExtensions.Field%2A> method provides support for accessing columns as nullable types. If the underlying value in the <xref:System.Data.DataSet> is <xref:System.DBNull.Value?displayProperty=nameWithType>, the returned nullable type will have a value of **null**.
417417
418-
If the value of the specified <xref:System.Data.DataColumn> is null and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value>.
418+
If the value of the specified <xref:System.Data.DataColumn> is null and `T` is a reference type or nullable type, then the return type will be **null**. The <xref:System.Data.DataRowExtensions.Field%2A> method will not return <xref:System.DBNull.Value?displayProperty=nameWithType>.
419419
420420
The <xref:System.Data.DataRowExtensions.Field%2A> method does not perform type conversions. If type conversion is required, you should first obtain the column value by using the <xref:System.Data.DataRowExtensions.Field%2A> method. The column value should then be converted to another type.
421421
@@ -483,7 +483,7 @@
483483
<format type="text/markdown"><![CDATA[
484484
485485
## Remarks
486-
If `value` is **null**, the <xref:System.Data.DataRowExtensions.SetField%2A> method converts the **null** value to <xref:System.DBNull.Value> in the underlying <xref:System.Data.DataColumn>.
486+
If `value` is **null**, the <xref:System.Data.DataRowExtensions.SetField%2A> method converts the **null** value to <xref:System.DBNull.Value?displayProperty=nameWithType> in the underlying <xref:System.Data.DataColumn>.
487487
488488
The <xref:System.Data.DataRowExtensions.SetField%2A> method does not perform any type conversions. This does not mean, however, that a type conversion will not occur. The <xref:System.Data.DataRowExtensions.SetField%2A> method exposes the ADO.NET 2.0 behavior of the <xref:System.Data.DataRow> class. A type conversion could be performed by the <xref:System.Data.DataRow> object and the converted value would then be saved to the row.
489489
@@ -545,7 +545,7 @@
545545
<format type="text/markdown"><![CDATA[
546546
547547
## Remarks
548-
If `value` is **null**, the <xref:System.Data.DataRowExtensions.SetField%2A> method converts the **null** value to <xref:System.DBNull.Value> in the underlying <xref:System.Data.DataColumn>.
548+
If `value` is **null**, the <xref:System.Data.DataRowExtensions.SetField%2A> method converts the **null** value to <xref:System.DBNull.Value?displayProperty=nameWithType> in the underlying <xref:System.Data.DataColumn>.
549549
550550
The <xref:System.Data.DataRowExtensions.SetField%2A> method does not perform any type conversions. This does not mean, however, that a type conversion will not occur. The <xref:System.Data.DataRowExtensions.SetField%2A> method exposes the ADO.NET 2.0 behavior of the <xref:System.Data.DataRow> class. A type conversion could be performed by the <xref:System.Data.DataRow> object and the converted value would then be saved to the row.
551551
@@ -606,7 +606,7 @@
606606
<format type="text/markdown"><![CDATA[
607607
608608
## Remarks
609-
If `value` is **null**, the <xref:System.Data.DataRowExtensions.SetField%2A> method converts the **null** value to <xref:System.DBNull.Value> in the underlying <xref:System.Data.DataColumn>.
609+
If `value` is **null**, the <xref:System.Data.DataRowExtensions.SetField%2A> method converts the **null** value to <xref:System.DBNull.Value?displayProperty=nameWithType> in the underlying <xref:System.Data.DataColumn>.
610610
611611
The <xref:System.Data.DataRowExtensions.SetField%2A> method does not perform any type conversions. This does not mean, however, that a type conversion will not occur. The <xref:System.Data.DataRowExtensions.SetField%2A> method exposes the ADO.NET 2.0 behavior of the <xref:System.Data.DataRow> class. A type conversion could be performed by the <xref:System.Data.DataRow> object and the converted value would then be saved to the row.
612612

0 commit comments

Comments
 (0)