Click or drag to resize

DataRowExtensionToDictionary Method (DataRow)

Creates a new dictionary whose key value pairs represent the columns of the given DataRow together with their values. If the row is null, an empty dictionary is created.

Namespace:  TB.ComponentModel
Assembly:  UniversalTypeConverter (in UniversalTypeConverter.dll) Version: 2.0.0
Syntax
C#
public static Dictionary<string, Object> ToDictionary(
	this DataRow row
)

Parameters

row
Type: System.DataDataRow
The DataRow whose columns are added to the new dictionary.

Return Value

Type: DictionaryString, Object
A new dictionary which contains the columns of row together with their values. If row is null, an empty dictionary is returned.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataRow. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also