This documentation is archived and is not being maintained.

DataTable.MinimumCapacity Property

Gets or sets the initial starting size for this table.

[Visual Basic]
Public Property MinimumCapacity As Integer
public int MinimumCapacity {get; set;}
public: __property int get_MinimumCapacity();
public: __property void set_MinimumCapacity(int);
public function get MinimumCapacity() : int;
public function set MinimumCapacity(int);

Property Value

The initial starting size in rows of this table. The default is 25.


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.


[Visual Basic, C#, C++] The following example sets the MinimumCapacity of a DataTable.

[Visual Basic] 
Private Sub SetMinimumCapacity(ByVal myTable As DataTable)
   ' Change the MinimumCapacity.
   myTable.MinimumCapacity = 100
End Sub

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

 void SetMinimumCapacity(DataTable* myTable){
    // Change the MinimumCapacity.
    myTable->MinimumCapacity = 100;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataTable Class | DataTable Members | System.Data Namespace