Extension method to convert dynamic data to a DataTable. Useful for databinding.

Namespace: DotNetNuke.Collections
Assembly: DotNetNuke (in DotNetNuke.dll)

Syntax

C#
public static DataTable ToDataTable(
	this IEnumerable<Object> items
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function ToDataTable ( 
	items As IEnumerable(Of Object)
) As DataTable

Parameters

items
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'Object>)>)>
paramitemsM:DotNetNuke.Collections.EnumerableExtensions.ToDataTable(System.Collections.Generic.IEnumerable{System.Object})

Return Value

A DataTable with the copied dynamic data.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'Object>)>)>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [b8020aae-374d-46a9-bcb7-8cc2390b93b6] or [175ce3ff-9bbf-4e64-8421-faeb81a0bb51].

See Also