Home arrow ADO.NET arrow Page 3 - Datasets in Microsoft.Net

Datasets in Microsoft.Net

ADO.NET was designed to meet the needs of a new programming model: disconnected data architecture, tight integration with XML, common data representation with the ability to combine data from multiple and varied data sources, and optimized facilities for interacting with a database, all native to the .NET Framework.The ADO.NET DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the source of the data it contains.

Author Info:
By: Raghav Nayak
Rating: 4 stars4 stars4 stars4 stars4 stars / 159
March 24, 2004
  1. · Datasets in Microsoft.Net
  2. · RecordSet Objects
  3. · Validating data in DataSet
  4. · Validation Properties of the DataColumn
  5. · The DataTable Objectís Constraints Collection
  6. · Creating Dataset at Design Time
  7. · Adding DataColumn Objects
  8. · New DataSet

print this article

Datasets in Microsoft.Net - Validating data in DataSet
(Page 3 of 8 )

Databases offer different mechanisms that you can use to ensure that the data in your database is valid. The sample Northwind database has many rules and constraints defined. The CustomerID column in the Customers table must be populated with a string of up to five characters, and that value must be unique within the table. The Orders table generates a new OrderID value for each row and requires that the CustomerID value for each row refer to an existing entry in the Customers table.

Sometimes youíll want to apply similar rules to validate data in your application before submitting changes to your database. For example, letís say youíre shopping on line and reach the page where you purchase the items in your basket. Most Web sites will make sure youíve entered information into each of the required fields before they submit your order information to the appropriate database.

This type of logic might seem redundant because the database probably has similar validation rules defined. However, adding validation rules to your application can improve its performance. If a user fails to enter a credit card number, either by accident or in the hope that the system programmers were extremely lazy, the code for the Web page can easily determine that it canít successfully submit the order without having to contact the database. The other benefits of this approach are a slight reduction of network traffic and a lighter load on your database.

The ADO.NET DataSet offers many of the same data validation mechanisms available in database systems. You can separate these validation mechanisms, also called constraints, into two categoriesócolumn-level restrictions and table-level restrictions.

blog comments powered by Disqus

- Datasets in Microsoft.Net
- Latest Developments in the .Net World
- Introduction to .NET
- Automatic Generation of Single Table SQL Sta...
- Data Access in .NET using C#: Part 1
- All You Need To Know About ADO.NET: Part 2/2
- All You Need To Know About ADO.NET: Part 1/2
- Easing Transition From ASP and ADO to ASP.NE...
- A Practical Comparison of ADO and ADO.NET

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials