
Create a Data-centric Application
If you ...
-
Are navigating between multiple, discrete tables of results ...
-
Are manipulating data from multiple sources (for example, from different databases, from XML files, spreadsheets, and so on, all in the same dataset) ...
-
Are exchanging data with other applications ...
-
Are reusing the same set of rows and intend to cache them (for example, sorting, searching, and filtering cached results) ...
-
Are doing a lot of processing per row ...
-
Are manipulating the data using XML operations such as XML transforms or XPath ...
-
Want ease of programming ...
Then use a dataset - for details, see Datasets in Visual Studio Overview.
Otherwise, use direct access (data commands and data readers) - for details, see Recommendations for Data Access Strategies.
For example, you would use data commands and data readers for:
-
Performing DDL commands
-
Performing updates or deletes based on a selection criteria
-
Programmatically inserting records that are not based on user interaction
-
Calling stored procedures to execute logic inside the server
-
Retrieving scalar values from the database
-
Processing a set of results in a forward only manner without updating and without caching the results
-
Processing a set of results too large to fit in memory
Web-based Data Applications
Windows Forms-based Data Applications
Use Windows Forms - for details, see Creating Client Data Applications.
If you ...
-
Are performing DDL commands ...
-
Are calling stored procedures to execute logic inside the server ...
-
Are retrieving scalar values from the database ...
-
Are processing a set of results in a forward-only manner without displaying, updating, or caching the results ...
-
Are processing a set of results too large to fit in memory ...
Then use direct access (data commands and data readers) - for details, see Recommendations for Data Access Strategies
Otherwise, use a dataset - for details, Datasets in Visual Studio Overview.
For example, you would use a dataset if you:
-
Are binding results to a form to let the user view, insert, update, or delete records
-
Are navigating between multiple tables of results
-
Are manipulating data from multiple sources (for example, from different databases, from XML files, spreadsheets, and so on, all in the same dataset)
-
Are exchanging data with other applications
-
Are reusing the same set of rows (for example, sorting, searching, and filtering retrieved results)
-
Are manipulating the data using XML operations such as XML transforms or XPath
Smart Device-based Data Applications
Office-based Data Applications