DataTableExtensionsToList Method
Converts the source DataTable to a ListT.
Namespace: DevCase.Extensions.DataTableExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static List<Dictionary<string, Object>> ToList(
this DataTable sender
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function ToList (
sender As DataTable
) As List(Of Dictionary(Of String, Object))
Dim sender As DataTable
Dim returnValue As List(Of Dictionary(Of String, Object))
returnValue = sender.ToList()
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static List<Dictionary<String^, Object^>^>^ ToList(
DataTable^ sender
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member ToList :
sender : DataTable -> List<Dictionary<string, Object>>
No code example is currently available or this language may not be supported.
- sender DataTable
-
The source DataTable.
ListDictionaryString,
Object
The resulting
ListT.
In Visual Basic and C#, you can call this method as an instance method on any object of type
DataTable. 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).
This is a code example.
No code example is currently available or this language may not be supported.
Dim dt As New DataTable()
dt.Columns.Add("Name", GetType(String))
dt.Columns.Add("Date", GetType(Date))
dt.Rows.Add("Elektro", Date.Parse("01-01-2016"))
Dim list As List(Of Dictionary(Of String, Object)) = dt.ToList()
For Each dict As Dictionary(Of String, Object) In list
For Each key As String In dict.Keys
Console.WriteLine("Name: {0}, Value:{1}", key, dict(key).ToString())
Next
Next
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.