<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="http://aspnet.4guysfromrolla.com/rss/rss2html.xsl" version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>4GuysFromRolla.com :: Data Source Controls Article Series</title>
<link>http://aspnet.4guysfromrolla.com/articles/011106-1.aspx</link>
<description>An article series on ASP.NET's data source controls.</description>
<language>en-us</language>
<webMaster>mitchell@4guysfromrolla.com (Scott Mitchell)</webMaster>
<atom:link href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml" rel="self" type="application/rss+xml" />

<item>
	<title>Accessing and Updating Data in ASP.NET: Filtering Data Using a CheckBoxList</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/062007-1.aspx"&gt;Deleting Data&lt;/a&gt; - see how to delete data using
a SqlDataSource control. Also looks at how to programmatically cancel a delete.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating Basics&lt;/a&gt; - learn the basics of updating database data using a 
SqlDataSource control. Also examines using the GridView to provide a web-based editing interface.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080807-1.aspx"&gt;Customizing the Editing Interface&lt;/a&gt; - see how to
customize the GridView's columns to provide a customized editing interface that includes input validation and alternative
user interface elements.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112807-1.aspx"&gt;Handling Database NULL Valuese&lt;/a&gt; - explore how to
extend the GridView's customized editing interface to handle database NULL values.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/052108-1.aspx"&gt;Using Optimistic Concurrency&lt;/a&gt; - see how to prevent
concurrent users from overwritting one anothers changes by using concurrency control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.4guysfromrolla.com/articles/012010-1.aspx"&gt;Filtering Data Using a CheckBoxList&lt;/a&gt; - learn how to filter
	data based on the end user's selections in a CheckBoxList.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://www.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt;, an earlier installment in this article series, showed how to filter
the data returned by ASP.NET's data source controls. In a nutshell, the data source controls can include parameterized queries whose parameter values are defined via
parameter controls. For example, the SqlDataSource can include a parameterized &lt;code&gt;SelectCommand&lt;/code&gt;, such as: &lt;code&gt;SELECT * FROM Books WHERE Price &gt; @Price&lt;/code&gt;.
Here, &lt;code&gt;@Price&lt;/code&gt; is a &lt;i&gt;parameter&lt;/i&gt;; the value for a parameter can be defined declaratively using a &lt;i&gt;parameter control&lt;/i&gt;. ASP.NET offers a variety of
parameter controls, including ones that use hard-coded values, ones that retrieve values from the querystring, and ones that retrieve values from session, and others.
&lt;/p&gt;&lt;p&gt;
Perhaps the most useful parameter control is the ControlParameter, which retrieves its value from a Web control on the page. Using the ControlParameter we can filter the
data returned by the data source control based on the end user's input. While the ControlParameter works well with most types of Web controls, it does not work as expected
with the CheckBoxList control. The ControlParameter is designed to retrieve a single property value from the specified Web control, but the
CheckBoxList control does not have a property that returns all of the values of its selected items in a form that the CheckBoxList control can use. Moreover, if you are
using the selected CheckBoxList items to query a database you'll quickly find that SQL does not offer out of the box functionality for filtering results based on a user-supplied
list of filter criteria.
&lt;/p&gt;&lt;p&gt;
The good news is that with a little bit of effort it is possible to filter data based on the end user's selections in a CheckBoxList control. This article starts with a look
at how to get SQL to filter data based on a user-supplied, comma-delimited list of values. Next, it shows how to programmatically construct a comma-delimited list that represents
the selected CheckBoxList values and pass that list into the SQL query. Finally, we'll explore creating a custom parameter control to handle this logic declaratively.
Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://www.4guysfromrolla.com/articles/012010-1.aspx</link>
	<guid>http://www.4guysfromrolla.com/articles/012010-1.aspx</guid>
	<pubDate>Wed, 20 Jan 2010 00:00:00 GMT</pubDate>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Using Optimistic Concurrency</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/062007-1.aspx"&gt;Deleting Data&lt;/a&gt; - see how to delete data using
a SqlDataSource control. Also looks at how to programmatically cancel a delete.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating Basics&lt;/a&gt; - learn the basics of updating database data using a 
SqlDataSource control. Also examines using the GridView to provide a web-based editing interface.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080807-1.aspx"&gt;Customizing the Editing Interface&lt;/a&gt; - see how to
customize the GridView's columns to provide a customized editing interface that includes input validation and alternative
user interface elements.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112807-1.aspx"&gt;Handling Database NULL Valuese&lt;/a&gt; - explore how to
extend the GridView's customized editing interface to handle database NULL values.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/052108-1.aspx"&gt;Using Optimistic Concurrency&lt;/a&gt; - see how to prevent
concurrent users from overwritting one anothers changes by using concurrency control.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
Because multiple users can visit the same web page concurrently, it is possible for a user visiting a data modification page to inadvertently overwrite
the modifications made by another user. Consider a page with an editable GridView. If two users visit this page simultaneously from different computers
and both edit the same row, whomever saves the first will have her changes overwritten by whomever saves the row last. This type of behavior is known as
"last write wins" and is the default behavior for web applications.
&lt;p&gt;
"Last write wins" is sufficient in applications where it is very rare for two users to be simultaneously working on the same data. If it is
commonplace for multiple users to be modifying the same set of data, you should consider implementing some form of &lt;i&gt;concurrency control&lt;/i&gt;.
There are two flavors of concurrency control: optimistic and pessimistic. Optimistic assumes that concurrency violations are rare and that if such an error
occurs that it's adequate to ask one of the conflicting parties to re-enter their information. Pessimistic concurrency, on the other hand, implements
policies to ensure that concurrency violations cannot occur. These policies may add friction to the end user's data entry experience.
&lt;p&gt;
Microsoft offers a form of optimistic concurrency control from the SqlDataSource control that can be enabled by ticking a checkbox. This article looks
at different types of concurrency control and then shows how to implement the built-in optimistic concurrency control offered by the SqlDataSource control.
Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/052108-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/052108-1.aspx</guid>
	<pubDate>Wed, 21 May 2008 00:00:00 GMT</pubDate>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Handling Database NULL Values</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/062007-1.aspx"&gt;Deleting Data&lt;/a&gt; - see how to delete data using
a SqlDataSource control. Also looks at how to programmatically cancel a delete.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating Basics&lt;/a&gt; - learn the basics of updating database data using a 
SqlDataSource control. Also examines using the GridView to provide a web-based editing interface.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080807-1.aspx"&gt;Customizing the Editing Interface&lt;/a&gt; - see how to
customize the GridView's columns to provide a customized editing interface that includes input validation and alternative
user interface elements.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112807-1.aspx"&gt;Handling Database NULL Valuese&lt;/a&gt; - explore how to
extend the GridView's customized editing interface to handle database NULL values.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
In the last two installments of this article series -
&lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating Basics&lt;/a&gt; and &lt;a href="http://aspnet.4guysfromrolla.com/articles/080807-1.aspx"&gt;Customizing the
Editing Interface&lt;/a&gt; - we saw how to configure the SqlDataSource control to issue &lt;code&gt;UPDATE&lt;/code&gt; statements to a 
database and how to then configure the GridView control to work in tandem with the SqlDataSource control to provide a 
web-based editing interface. By default, the GridView's editing interface renders a TextBox for each editable column in the
grid. However, in certain scenarios we may want to customize the editing interface by including validation controls or by
using an alternative Web control to collect the user's input. In particular, we customized the editing interface so that 
when editing a product from the Northwind database, a user could select the product's category through a DropDownList 
control rather than having to enter the actual &lt;code&gt;CategoryID&lt;/code&gt; value into a TextBox.
&lt;/p&gt;&lt;p&gt;
While the &lt;i&gt;Customizing the Editing Interface&lt;/i&gt; article provided a complete, working example of creating a customized
editing interface, it had one potentially criticial shortcoming - the approach did not work with products that had a
&lt;code&gt;NULL&lt;/code&gt; database value for their &lt;code&gt;CategoryID&lt;/code&gt;. For starters, the &lt;code&gt;SELECT&lt;/code&gt; query used to
populate the GridView used an &lt;code&gt;INNER JOIN&lt;/code&gt;, which only returned those products with a matching category record.
But even if we update the query to use a &lt;code&gt;LEFT JOIN&lt;/code&gt;, the DropDownList in the customized editing interface did
not include a list item representing the &lt;code&gt;NULL&lt;/code&gt; value, so a user would be unable to edit a product and change
the category from an existing value to &lt;code&gt;NULL&lt;/code&gt;.
&lt;/p&gt;&lt;p&gt;
In this article we will look at how to customize the DropDownList in the editing interface such that it can correctly
handle database &lt;code&gt;NULL&lt;/code&gt; values. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/112807-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/112807-1.aspx</guid>
	<pubDate>Wed, 28 Nov 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Customizing the Editing Interface</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/062007-1.aspx"&gt;Deleting Data&lt;/a&gt; - see how to delete data using
a SqlDataSource control. Also looks at how to programmatically cancel a delete.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating Basics&lt;/a&gt; - learn the basics of updating database data using a 
SqlDataSource control. Also examines using the GridView to provide a web-based editing interface.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080807-1.aspx"&gt;Customizing the Editing Interface&lt;/a&gt; - see how to
customize the GridView's columns to provide a customized editing interface that includes input validation and alternative
user interface elements.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
In the last installment of this article series, &lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating
Basics&lt;/a&gt;, we looked at how to configure the SqlDataSource control to issue &lt;code&gt;UPDATE&lt;/code&gt; statements to a database.
We then saw how the GridView control can work in tandem with the SqlDataSource control to provide a simple web-based
editing interface composed of textboxes for each data field. While this simplified interface enabled developers to create an 
editable interface with zero code and just a few clicks of the mouse, the interface is so simple that it is impractical for 
all but the most trivial scenarios. Some of these limitations were exhibited in the Updating Basics article when attempting to 
update a product's Category. In short, you had to modify the product's &lt;code&gt;CategoryID&lt;/code&gt; value, meaning that to 
change a product's category from Beverages to Dairy you would have to change the &lt;code&gt;CategoryID&lt;/code&gt; value from 1 to 4.
Likewise, the simplified interface lacks any input validation that may be necessary when editing required fields or fields
that must appear in a particular format (like dates or numbers).
&lt;/p&gt;&lt;p&gt;
Fortunately, the GridView's editing interface can be customized to include validation controls and alternative user interface
elements. It requires a little more effort, but in most cases these changes can be completed entirely through the
Designer or the page's declarative markup. In this installment we will extend the simplified editing interface from
Updating Basics to include validation controls for the &lt;code&gt;ProductName&lt;/code&gt; and &lt;code&gt;UnitPrice&lt;/code&gt; fields; we will
also replace the &lt;code&gt;CategoryID&lt;/code&gt; data field's textbox with a drop-down list that enumerates the possible categories.
Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/080807-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/080807-1.aspx</guid>
	<pubDate>Wed, 08 Aug 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Updating Basics</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/062007-1.aspx"&gt;Deleting Data&lt;/a&gt; - see how to delete data using
a SqlDataSource control. Also looks at how to programmatically cancel a delete.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/080107-1.aspx"&gt;Updating Basics&lt;/a&gt; - learn the basics of updating database data using a 
SqlDataSource control. Also examines using the GridView to provide a web-based editing interface.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET 2.0&lt;/a&gt;'s data source controls make it possible to retrieve, insert, update,
and delete data without having to write the tedious dedata access code that was so commonplace in &lt;a href="http://aspnet.4guysfromrolla.com/1.x/"&gt;ASP.NET 
version 1.x&lt;/a&gt;. Previous installments of this article series have looked at returning, inserting, and deleting data using the SqlDataSource
control. However, we have yet to look at updating data.
&lt;/p&gt;&lt;p&gt;
In addition to the SqlDataSource control, ASP.NET 2.0 introduces three new data Web controls: the GridView, the DetailsView, and the
FormView. These controls can work in unison with the data source controls to facilitate inserting, updating, and deleting data.
In this article we will examine basics of using the SqlDataSource and GridView controls to update records from a database. In particular, 
we look at enabling editing support in the GridView. Future installments will explore more advanced updating scenarios, such as customizing
the GridView's editing interface and programmatically setting the updated values. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/080107-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/080107-1.aspx</guid>
	<pubDate>Wed, 01 Aug 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Deleting Data</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/062007-1.aspx"&gt;Deleting Data&lt;/a&gt; - see how to delete data using
a SqlDataSource control. Also looks at how to programmatically cancel a delete.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET 2.0&lt;/a&gt;'s data source and data Web controls make working with data much easier than in previous versions by 
allowing for a declarative approach to working with data. In short, the data source controls make it possible to retrieve, insert, update,
and delete data without having to write the tedious dedata access code that was so commonplace in &lt;a href="http://aspnet.4guysfromrolla.com/1.x/"&gt;ASP.NET 
version 1.x&lt;/a&gt;. (A previous installment of this article series examined &lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;using the SqlDataSource to insert
data&lt;/a&gt; into a database.)
&lt;/p&gt;&lt;p&gt;
In this article we will focus on using the SqlDataSource control to delete records from a database. Specifically, we will look at three examples:
using a SqlDataSource and a bit of server-side code to delete a record selected from a drop-down list; 
and using the GridView Web control's built-in deleting support; and how to programmatically cancel a delete operation. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/062007-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/062007-1.aspx</guid>
	<pubDate>Wed, 20 Jun 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Inserting Data</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/050207-1.aspx"&gt;Inserting Data&lt;/a&gt; - learn how to insert data using
a SqlDataSource control. Also examines how to retrieve the &lt;code&gt;IDENTITY&lt;/code&gt; column value for the just-inserted record.&lt;/li&gt;
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
ASP.NET 2.0's data source and data Web controls make working with data much easier than in previous versions. These controls 
allow for a declarative approach to working with data, without needing to write any cumbersome data access code. The 
articles we have explored in the series thus far have focused on understanding the core concepts of the data source
controls and how to retrieve data from the database. In addition to retrieving data, the data source controls can also
insert, update, and delete data.
&lt;/p&gt;&lt;p&gt;
In this article we will focus on using the SqlDataSource control to insert records into a database. We will look at three examples:
using a SqlDataSource and to insert a record using values entered by the user through various TextBoxes, DropDownLists, and
other Web controls on an ASP.NET page; inserting using a SqlDataSource and a &lt;a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/detailsview.aspx"&gt;DetailsView 
control&lt;/a&gt;; and determining the value of the just-inserted record's IDENTITY column. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/050207-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/050207-1.aspx</guid>
	<pubDate>Tue, 01 May 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Programmatically Accessing Data using the Data Source Controls</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041107-1.aspx"&gt;Programmatically Accessing Data using the Data Source Controls&lt;/a&gt; - 
programmatically retrieve, insert, delete, and update data using the SqlDataSource and AccessDataSource controls.&lt;/li&gt;

&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
Working with data in &lt;a href="http://aspnet.4guysfromrolla.com/1.x/"&gt;ASP.NET version 1.x&lt;/a&gt; required writing data access code.
This involved establishing a connection to the database, specifying the SQL command, and then executing the command. 
&lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET 2.0&lt;/a&gt;'s data source controls greatly simplifies this process by
encapsulating the data access pattern within a Web control construct. As such, data can be retrieved or modified and bound
to a Web control without writing a single line of code. We explored the essentials of declarative data binding earlier in
this article series in the &lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt;
and &lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; articles.
&lt;p&gt;
In addition to being used declaratively, the data source Web controls can also be accessed programmatically. It is possible 
to add a SqlDataSource or AccessDataSource control to a web page, specify &lt;code&gt;SELECT&lt;/code&gt;, 
&lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, or &lt;code&gt;DELETE&lt;/code&gt; queries, and then to programmatically execute one of
the control's SQL commands. Such an approach is useful when you need to work with data programmatically, but want to avoid
having to write the boilerplate data access code. In short, using the data source controls in this manner allows for data
to be accessed programmatically with a single line of code.
&lt;p&gt;
In this article we will examine how to use the SqlDataSource control to programmatically retrieve, insert, and delete data.
Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/041107-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/041107-1.aspx</guid>
	<pubDate>Wed, 11 Apr 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Declaratively Caching Data</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/012407-1.aspx"&gt;Declaratively Caching Data&lt;/a&gt; - learn how to cache data
to the data cache simply by setting a couple of data source control properties.&lt;/li&gt;

&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
The ASP.NET 2.0 data source controls provide a declarative means for accessing and working with data. Simply set a few properties
of the data source control, bind it to a data Web control, and, voila, data is being retrieved and displayed without
having written a single line of code!
&lt;/p&gt;&lt;p&gt;
In addition to working with data declaratively, the data source controls can also &lt;i&gt;cache&lt;/i&gt; data declaratively.
Caching is a common technique used in data-driven applications to boost performance, and works by storing database data
in memory where it can be more efficiently accessed. ASP.NET provides the &lt;i&gt;data cache&lt;/i&gt;, which is a programmatically-accessible
cache that is commonly used to store database results. See &lt;a href="http://aspnet.4guysfromrolla.com/articles/022802-1.aspx"&gt;Caching
in ASP.NET&lt;/a&gt; for more details on using the data cache and other caching options in ASP.NET.
&lt;/p&gt;&lt;p&gt;
What's worth noting about the data source controls is that they offer &lt;i&gt;declarative&lt;/i&gt; access to the data cache. By simply
setting a few properties, the data source controls will happily store their retrieved data in the data cache. Then, the
next time the data source is asked to retrieve data, they'll pull that data from the cache instead of returning to the
database. In this article we'll explore how to setup a data source control so that it stores it caches its results. Read on
to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/012407-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/012407-1.aspx</guid>
	<pubDate>Wed, 24 Jan 2007 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Examining the Data Source Control's Events</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/112206-1.aspx"&gt;Examining the Data Source Control's Events&lt;/a&gt; - explore the
events raised during a data source control's lifecycle.&lt;/li&gt;
   
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
The data source controls in &lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET 2.0&lt;/a&gt; provide a simple, declarative approach
for accessing and modifying data. The &lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt;
article that kicked off this article series examined how to add data source controls to a page, specify the data to retrieve and/or
modify, and bind that data to a data Web control (such as a GridView, DetailsView, or FormView). While point-and-click data access
is useful for prototyping and for beginners or hobbyists who have little to no programming experience, wizards and the like
are generally frowned upon by more seasoned developers since they typically offer ease of use at the cost of extensibility and
customizability. The ASP.NET 2.0 data source controls, however, provide the best of both worlds, in my opinion - they can be quickly
and easily configured to work with data, yet through a myriad of events that are raised during the data source
controls' lifecycles, provide the flexibility for use in more advanced scenarios.
&lt;/p&gt;&lt;p&gt;
The SqlDataSource and ObjectDataSource controls are the two most commonly used data source controls, and they provide a means
for retrieving and modifying data from either a database or object library, respectively. Both controls raise pre- and post-action
events when selecting, inserting, updating, and deleting data. For example, the SqlDataSource and ObjectDataSource raise their
&lt;code&gt;Select&lt;b&gt;ing&lt;/b&gt;&lt;/code&gt; events immediately before performing the SQL query or invoking the object method to retrieve data.
After the data has been retrieved, the &lt;code&gt;Select&lt;b&gt;ed&lt;/b&gt;&lt;/code&gt; events fires.
By creating a &lt;code&gt;Selecting&lt;/code&gt; event handler, you can examine and massage the parameters used in selecting data; the
&lt;code&gt;Selected&lt;/code&gt; event indicates, among other things, if an exception occurred during the operation. Similarly named
pre- and post-action events fire during the updating, inserting, and deleting processes, as well.
&lt;/p&gt;&lt;p&gt;
Having a solid understanding of the data source events and event lifecycle has a slew of benefits. Many real-world scenarios
require that the parameters being used for selecting, inserting, updating, or deleting be programmatically assigned or altered,
which can be accomplished in the appropriate pre-action event. Moreover, to gracefully handle database- or object library-level 
exceptions in the page, the post-action event handlers should be used. And when debugging, the pre-action events provide an 
opportunity for examining what parameters (if any) are being used to query the data. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/112206-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/112206-1.aspx</guid>
	<pubDate>Wed, 22 Nov 2006 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Creating Custom Parameter Controls</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/110106-1.aspx"&gt;Creating Custom Parameter Controls&lt;/a&gt; - learn how
to create your own custom, declarative &lt;code&gt;Parameter&lt;/code&gt; controls for use in the data source controls' parameters collections.&lt;/li&gt;
   
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;
As discussed in previous installments of this article series, &lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET 2.0&lt;/a&gt;
ships with a number of built-in data source controls
that can be used to programmatically access data (the SqlDataSource, ObjectDataSource, &lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;XmlDataSource&lt;/a&gt;, 
and so on). The SqlDataSource and ObjectDataSource commonly return or modify data based upon &lt;i&gt;parameters&lt;/i&gt;. For example,
a SqlDataSource might use a parameterized query, like &lt;code&gt;SELECT * FROM &lt;i&gt;TableName&lt;/i&gt; WHERE &lt;i&gt;ColumName&lt;/i&gt; = @&lt;i&gt;parameterName&lt;/i&gt;&lt;/code&gt;;
the ObjectDataSource's parameters are those expected input parameters to the methods it invokes.
In either case, the &lt;i&gt;values&lt;/i&gt; of the parameters can be specified using &lt;code&gt;Parameter&lt;/code&gt; controls.
(See &lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; installment
for more information on using parameters with the data source controls.)
&lt;/p&gt;&lt;p&gt;
A &lt;code&gt;Parameter&lt;/code&gt; controls is a control whose purpose is to provide a value for a given parameter. ASP.NET 2.0 ships with
seven &lt;code&gt;Parameter&lt;/code&gt; controls - the generic 
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.parameter.aspx"&gt;&lt;code&gt;ControlParameter&lt;/code&gt;&lt;/a&gt; and
the more specific
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.controlparameter.aspx"&gt;&lt;code&gt;ControlParameter&lt;/code&gt;&lt;/a&gt;, 
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.cookieparameter.aspx"&gt;&lt;code&gt;CookieParameter&lt;/code&gt;&lt;/a&gt;, 
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.formparameter.aspx"&gt;&lt;code&gt;FormParameter&lt;/code&gt;&lt;/a&gt;,
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.profileparameter.aspx"&gt;&lt;code&gt;ProfileParameter&lt;/code&gt;&lt;/a&gt;, 
&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.querystringparameter.aspx"&gt;&lt;code&gt;QueryStringParameter&lt;/code&gt;&lt;/a&gt;, 
and &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.sessionparameter.aspx"&gt;&lt;code&gt;SessionParameter&lt;/code&gt;&lt;/a&gt; controls -
which pull their values from web controls on the page, session state, querystring fields, and so on.
&lt;/p&gt;&lt;p&gt;
If you need to use a value that's &lt;i&gt;not&lt;/i&gt; provided by one of the specific &lt;code&gt;Parameter&lt;/code&gt; controls, you can use
the generic &lt;code&gt;Parameter&lt;/code&gt; control and set its value programmatically (a topic we'll address in a future article
in this series). Alternatively, you can create a &lt;i&gt;custom&lt;/i&gt; &lt;code&gt;Parameter&lt;/code&gt; control that grabs the specific data
you need. Creating such a custom &lt;code&gt;Parameter&lt;/code&gt; control is quite easy and straightforward, as we'll see in this
article. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/110106-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/110106-1.aspx</guid>
	<pubDate>Wed, 01 Nov 2006 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Retrieving XML Data with XmlDataSource Control</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/092706-1.aspx"&gt;Retrieving XML Data with XmlDataSource Control&lt;/a&gt; - see how
to retrieve both remote and local XML data and display it in a data Web control.&lt;/li&gt;
   
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
With its new declarative data source controls and improved data Web controls, &lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET 
2.0&lt;/a&gt; has greatly simplified the process of working with data. In Part 2 of this article series, 
&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt;, we looked at how to use the
SqlDataSource control to retrieve data from a relational database, which could then be bound to any data Web control (such
as the &lt;a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/gridview.aspx"&gt;GridView&lt;/a&gt;, DetailsView, 
FormView, DataList, Repeater, and so on). &lt;i&gt;XML&lt;/i&gt; data can be accessed (and displayed) just as easily with the XmlDataSource
control.
&lt;/p&gt;&lt;p&gt;
The XmlDataSource control makes accessing, filtering, and transforming XML data a simple, code-free process. Additionally,
the &lt;code&gt;XPath()&lt;/code&gt; and &lt;code&gt;XPathSelect()&lt;/code&gt; databinding methods added to ASP.NET 2.0 make displaying particular
XML values or binding entire XML nodesets just as easy. And the XML data accessed can be from a local file or automatically
downloaded from a specified URL.
In this article we will examine how to use the XmlDataSource control and the &lt;code&gt;XPath()&lt;/code&gt; and &lt;code&gt;XPathSelect()&lt;/code&gt; 
databinding methods, displaying the results in a variety of data Web controls. Read on to learn more!
&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/092706-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/092706-1.aspx</guid>
	<pubDate>Wed, 27 Sep 2006 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>


<item>
	<title>Accessing and Updating Data in ASP.NET: Filtering Database Data with Parameters</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET's new data 
source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/030106-1.aspx"&gt;Filtering Database Data with Parameters&lt;/a&gt; - learn how to
retrieve just a subset of database data based on hard-coded values and values from the querystring, other Web controls on the page,
session variables, and so on.&lt;/li&gt;
   
&lt;p align="right"&gt;
(&lt;a href="http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml"&gt;Subscribe to this Article Series!
&lt;img src="http://www.4guysfromrolla.com/images/xml.gif" width="36" height="14" border="0" /&gt;&lt;/a&gt;)&lt;/p&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
In &lt;a href="http://aspnet.4guysfromrolla.com/articles/022206-1.aspx"&gt;Part 2&lt;/a&gt; of this article series we looked at how to access
relational database data using the AccessDataSource and SqlDataSource controls. However, in Part 2 we only looked at how to
retrieve &lt;i&gt;all&lt;/i&gt; of the records from a table, view, stored procedure, or ad-hoc SQL query. Often, we only want to retrieve
a subset of data based on various criteria. When searching for a book on Amazon.com, for example, the search page retrieves only 
the data from the database that matches the search terms you entered; when viewing the details for a particular book, only 
the particular book's information is queried from the database.
&lt;/p&gt;&lt;p&gt;
Results are filtered in a SQL statement using the &lt;code&gt;WHERE&lt;/code&gt; clause, which contains a boolean expression. For each
record in the table being queried, the &lt;code&gt;WHERE&lt;/code&gt; expression is evaluated to determine whether or not to include that
record in the resultset.&lt;sup&gt;1&lt;/sup&gt; For example, a SQL query like: &lt;code&gt;SELECT ProductID, ProductName FROM Products WHERE
UnitPrice &lt; 15.00&lt;/code&gt; will return the &lt;code&gt;ProductID&lt;/code&gt; and &lt;code&gt;ProductName&lt;/code&gt; column values for all records
in the &lt;code&gt;Products&lt;/code&gt; table for which the statement &lt;code&gt;UnitPrice &lt; 15.00&lt;/code&gt; evaluates to True. In English, it
returns all products that cost strictly less than fifteen bucks.
&lt;/p&gt;&lt;p&gt;
The SqlDataSource and AccessDataSource controls can define the value by which the query is filtered by using &lt;i&gt;parameters&lt;/i&gt;,
and these parameters can retrieve their values from a variety of sources, including: the querystring, session variables,
other Web controls on the page, and so on. Like the connection string and &lt;code&gt;SELECT&lt;/code&gt; query, the filter parameters
values for a data source control can be set declaratively, meaning you do not need to write a line of code. These parameter
values can also be set programmatically, though, for cases where you might need to base the filter value on programmatic
logic (such as the currently logged-in user's username).
&lt;/p&gt;&lt;p&gt;
In this article we will examine how to declaratively filter the results of a SQL query using parameters in a SqlDataSource. We'll see examples
of how to use hard-coded filter values, and well as examples with filter values taken from the querystring and other Web controls
on the page. Read on to learn more!&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/030106-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/030106-1.aspx</guid>
	<pubDate>Wed, 01 Mar 2006 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>

<item>
	<title>Accessing and Updating Data in ASP.NET: Accessing Database Data</title>
	<description>
&lt;table align=&quot;center&quot; style=&quot;BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow&quot;&gt;&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET 2.0&apos;s Data Source Controls&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;

ASP.NET 2.0 introduced a number of new Web controls designed for accessing and modifying data.
These controls allow page developers to declaratively access and modify data without writing any
code to perform the data access. This article is one in a series of articles on ASP.NET 2.0&apos;s new data 
source controls.
&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href=&quot;http://aspnet.4guysfromrolla.com/articles/011106-1.aspx&quot;&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://aspnet.4guysfromrolla.com/articles/022206-1.aspx&quot;&gt;Accessing Database Data&lt;/a&gt; - shows how to use the
SqlDataSource and AccessDataSource controls to query data from a relational database.&lt;/li&gt;&lt;p align=&quot;right&quot;&gt;

(&lt;a href=&quot;http://aspnet.4guysfromrolla.com/rss/dataSourceControls.xml&quot;&gt;Subscribe to this Article Series!
&lt;img src=&quot;http://www.4guysfromrolla.com/images/xml.gif&quot; width=&quot;36&quot; height=&quot;14&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;)&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;

One of the coolest new features of ASP.NET 2.0 is its new Data Source controls. The Data Source controls are a collection of
Web controls designed to provide a declarative approach to accessing and modifying data. In short, with the Data Source
controls you can work with data without having to write a lick of data access code. Compare this to ASP.NET 1.x, which
required oft-repeated code to access data. For example, to display the contents of a database table in a web page with ASP.NET 1.x,
you&apos;d need to write code to:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Connect to the database,&lt;/li&gt;&lt;li&gt;Issue the command,&lt;/li&gt;&lt;li&gt;Retrieve the results, and&lt;/li&gt;&lt;li&gt;Work with the results / bind them to a data Web control (such as a DataGrid)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;While only five to ten lines of code is needed to perform these four steps, and libraries like the

&lt;a href=&quot;http://aspnet.4guysfromrolla.com/articles/070203-1.aspx&quot;&gt;Data Access Application Block&lt;/a&gt; help reduce the volume
of code that you need to write, the fact remains that in order to access or modify data in an ASP.NET 1.x application you
must write code.
&lt;/p&gt;&lt;p&gt;
With ASP.NET 2.0, data can be accessed entirely from declarative markup. In this article we&apos;ll be examining how to access data
from databases with the SqlDataSource and AccessDataSource controls. With both of these controls you can specify
the &lt;code&gt;SELECT&lt;/code&gt; query to use and any parameters in the &lt;code&gt;WHERE&lt;/code&gt; clause as properties of the Data Source 
controls. The code to connect to the database, issue the command, and retrieve the results is handled internally by the
Data Source control. With the declarative, &quot;code free&quot; Data Source controls you can create a page that displays database
data in under 15 seconds and without having to write a line of code. Read on to learn more!

&lt;br /&gt;&lt;a href=&quot;http://aspnet.4guysfromrolla.com/articles/022206-1.aspx&quot; class=&quot;readmore&quot;&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;
	</description>
	<link>http://aspnet.4guysfromrolla.com/articles/022206-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/022206-1.aspx</guid>
	<pubDate>Wed, 22 Feb 2006 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>


<item>
	<title>Accessing and Updating Data in ASP.NET: Data Source Control Basics</title>
	<description>
&lt;table align="center" style="BORDER-RIGHT: #333 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #333 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #333 1px solid; WIDTH: 77%; PADDING-TOP: 8px; BORDER-BOTTOM: #333 1px solid; BACKGROUND-COLOR: lightyellow"&gt;
&lt;tr&gt;&lt;th&gt;A Multipart Series on ASP.NET's Data Source Controls&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;
This article is one in a series of articles on ASP.NET's data source controls.
&lt;br /&gt;&lt;br /&gt;
&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/011106-1.aspx"&gt;Data Source Control Basics&lt;/a&gt; - explores the concepts
and advantages of data source controls, and compares their usage in ASP.NET 2.0 to data access techniques in ASP.NET 1.x.&lt;/li&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;When I started my career as a web developer, Microsoft's Active Server Pages version 2.0 had just burst onto the scenes.
Back in my day, web developers were responsible for writing code to both access and display data. That is, we had to write 
code that queried the database and then had to write more code to squirt out the appropriate data surrounded by the 
applicable HTML elements. &lt;a href="http://aspnet.4guysfromrolla.com/1.x/"&gt;ASP.NET version 1.x&lt;/a&gt; simplified this process
with the host of data Web controls (the DataGrid, DataList, Repeater, DropDownList, and so on). With just two lines of code
these controls could emit their own, proper HTML elements when given an arbitrary data source. Today, with 
&lt;a href="http://aspnet.4guysfromrolla.com/2.0/"&gt;ASP.NET version 2.0&lt;/a&gt; and its data source controls, developers can both
access data and display it without writing a lick of code. You kids have it so easy these days!
&lt;/p&gt;&lt;p&gt;
In a nutshell, the ASP.NET 2.0 data source controls provide a declarative way to work with data. Rather than having to
write code to connect to a database, issue a command, and retrieve the results as a DataReader or DataSet, with the
data source controls these instructions can be specified through the standard Web control syntax. (Of course behind the scenes, the
data source controls are still performing the programmatic steps we had to take in ASP.NET 1.x.) Once a data source control
has been properly configured, it can be bound to any data Web control. When the page is visited, the data Web control
will automatically invoke the associated data source control, retrieve its data, and display it as configured.
&lt;/p&gt;&lt;p&gt;
While the data source controls are easy to get started with, there are a number of subtleties and issues that can cause
headaches. In this article series we'll examine the five built-in data source controls in detail. This first part, however,
examines the concepts shared among all five data source controls and how ASP.NET 2.0's data Web controls work with their
associated data source controls at runtime. Read on to learn more!
&lt;/p&gt;
	</description>
	
	<link>http://aspnet.4guysfromrolla.com/articles/011106-1.aspx</link>
	<guid>http://aspnet.4guysfromrolla.com/articles/011106-1.aspx</guid>
	<pubDate>Wed, 11 Jan 2006 00:00:00 GMT</pubDate>
	<author>mitchell@4guysfromrolla.com (Scott Mitchell)</author>
</item>
</channel>
</rss>
