Click or drag to resize
Accord.NET (logo) ExtensionMethodsAdd Method
Creates and adds multiple DataColumn objects with the given names at once.

Namespace:  Accord
Assembly:  Accord (in Accord.dll) Version: 3.4.0
Syntax
public static void Add(
	this DataColumnCollection collection,
	params string[] columnNames
)
Request Example View Source

Parameters

collection
Type: System.DataDataColumnCollection
The DataColumnCollection to add in.
columnNames
Type: SystemString
The names of the DataColumn to be created and added.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DataColumnCollection. 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).
Examples
DataTable table = new DataTable();

// Add multiple columns at once:
table.Columns.Add("columnName1", "columnName2");
See Also