dataset datacommand

  • Thread starter Thread starter Selen
  • Start date Start date
S

Selen

Hi,
When should I use dataset or datacommand? Do you know any articles about
this subject?

thanks......
 
Selen,

The two are not mutually exclusive. When you use a DataCommand, it is
what will be used to perform an operation on the database. If the operation
returns a result set, then you can store the results in a DataSet, usually
by calling the Fill method on a DataAdapter where the SelectCommand property
is set to your DataCommand.

Hope this helps.
 
I guess it's in MSDN somewhere, but I understood the deal only when
reading books on the subject - especially ADO.NET Cookbook from Oreilly.

"In a nutshell",
A dataset is a disconnected data store in memory which your app would
"Fill" with data (including multiple tables and data relations), change
at will, and "Update" back to the DB.
(if you don't use a dataset you have to use a DataReader, which is a
forward-only data cursor)

DataAdapters are in charge of Filling and Updating DataSets. They do
this by using DataCommands for select, update, insert and delete.

Each DataCommand uses a DataConnection to connect to the database.

HTH
 
Back
Top