Wieviele DataRow kann DataTable maximal haben ?

flaavia

Mitglied
Hallo

In der Online Hilfe gibt es eine Aussage zu der maximalen Anzahl an Reihen, die eine DB (DataTable) haben kann:

If you are creating a DataTable programmatically, you must first define its schema by adding DataColumn objects to the DataColumnCollection (accessed through the Columns property). For more information about adding DataColumn objects, see Adding Columns to a Table.

To add rows to a DataTable, you must first use the NewRow method to return a new DataRow object. The NewRow method returns a row with the schema of the DataTable, as it is defined by the table's DataColumnCollection. The maximum number of rows that a DataTable can store is 16,777,216. For more information, see Adding Data to a Table.

Weiß jemand wieviele Spalten (Columns) maximal möglich sind ?

Vielen Dank für alle Antworten im voraus
 
Hallo!

Hab eben mal gegooglt und hab dazu auch keine Infos gefunden, aber ich tippe mal auf einen Wert zwischen 256 und 16.777.216, jedenfalls normalerweise ausreichend.

Aber wenn Du es genau wissen willst, dann probiers doch einfach aus. Stichwort: Schleife. ;)

Erstelle eine while-Schleife, die pro Durchgang eine neue Spalte an die DataTable anhängt. Wichtig ist, dass Du einen Zähler mitlaufen lässt. Das ganze kommt dann noch in einen try-catch-Block und fertig. Am Ende lässt Du Dir den Wert des Zählers ausgeben. Programm kompilieren, starten und warten. Das kann dann schon ein paar "Sekündchen" dauern. Aber dann weisst Du es genau. :)

Die Frage ist nur, ob der Wert der Columns in Relation zur Anzahl der Rows und der einzelnen Feldinhalte steht. ;)
 

Neue Beiträge

Zurück