DataSet vs DataTable

  • Thread starter Thread starter csharpula csharp
  • Start date Start date
C

csharpula csharp

Hello,
Could you please tell me the difference between DataSet and DataTable?
Thank u!
 
To simplify things, a DataSet contains multiple DataTables.

To compare things to a typical relational database, a DataTable would be
roughly equivalent to a table in a database - whereas a DataSet is in many
ways like a database. A DataSet can define DataRelations - which define the
relationship between DataTables, much like a foreign key relationship can be
set up between tables in a database. DataSets, themselves, contain no data.
DataSets contain DataTables (which is where any data actually resides),
DataRelations, etc, but no data.

If you only need one in-memory "table" - then you can create a DataTable and
use it without also having it reside within a DataSet.

-HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top