Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
0 out of 1 rated this helpful - Rate this topic

DataTable.MinimumCapacity Property

Gets or sets the initial starting size for this table.

[Visual Basic]
Public Property MinimumCapacity As Integer
[C#]
public int MinimumCapacity {get; set;}
[C++]
public: __property int get_MinimumCapacity();
public: __property void set_MinimumCapacity(int);
[JScript]
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.

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.

Example

[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

[C#] 
private void SetMinimumCapacity(DataTable myTable){
   // Change the MinimumCapacity.
   myTable.MinimumCapacity = 100;
}

[C++] 
private:
 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.

Requirements

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.