Skip to main content
.NET Framework Class Library
DataTable..::.MinimumCapacity Property

Gets or sets the initial starting size for this table.

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Syntax
Public Property MinimumCapacity As Integer
public int MinimumCapacity { get; set; }
public:
property int MinimumCapacity {
	int get ();
	void set (int value);
}
member MinimumCapacity : int with get, set

Property Value

Type: System..::.Int32
The initial starting size in rows of this table. The default is 50.
Remarks

The MinimumCapacity allows the system to create an appropriate set of resources before fetching data. In a situation when performance is critical, setting this property can optimize performance.

Examples

The following example sets the MinimumCapacity of a DataTable.


Private Sub SetMinimumCapacity(ByVal table As DataTable)
   ' Change the MinimumCapacity.
   table.MinimumCapacity = 100
End Sub


private void SetMinimumCapacity(DataTable table)
{
    // Change the MinimumCapacity.
    table.MinimumCapacity = 100;
}

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

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.