DataTable Constructor
Initializes a new instance of the DataTable class with no arguments.
Assembly: System.Data (in System.Data.dll)
The constructor sets initial values for all properties of the DataTable object. The following table shows the properties and their default values. When an instance of DataTable is created, the following read/write properties are set to initial values.
Property | Default value |
|---|---|
CaseSensitive | Same as the parent DataSet, if it belongs to one. Otherwise, false. |
DisplayExpression | Empty string ("") |
Locale | Same as the parent DataSet object's CultureInfo (returned by the Locale property); if no parent exists, the default is the current system CultureInfo. |
MinimumCapacity | 50 rows. |
You can change the value for any of these properties through a separate call to the property.
The following example creates a new DataTable with DataColumn and DataRow, and displays it in a DataGridView control.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.