Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Arrays and DataTables?

Tags:

c#

.net

So I've been trying to better understand the difference between these two but all i can really find info on is the difference between DataSets and DataTables- a single Array can only hold one datatype, whereas from what i can tell, DataTables are basically a generic multidimensional array and it has a 1:1 relationship to the DataSource stored in memory. Is this accurate? are DataTables 'just' a generic multidimensional array or am i missing some fundamental difference?

like image 476
DaneEdw Avatar asked Sep 03 '26 13:09

DaneEdw


1 Answers

A DataTable models a database table in memory. The type can track changes etc in order to sync with a database. The columns (dimensions) can be referenced either by index or name.

A DataSet can hold a collection of such tables and the relationships between them (referential integrity constraints).

An array doesn't do any of that.

like image 154
Oded Avatar answered Sep 06 '26 03:09

Oded



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!