In my previous article (.NETDJ, Vol. 2, issue 4) we took a look at how
ASP.NET v2.0's SqlDataSource control allows Web developers to create a
dynamic Web site using data stored in a SQL database with little or no server
code. In this article we're going to build on that by delving into some of
the other new DataSource controls and how we can integrate data from non SQL
sources into an interactive Web page.
XmlDataSource
The XmlDataSource is a new server control used to provide access to
hierarchical data stored as XML. The first step in defining an XmlDataSource
is to specify the location of the data to be retrieved. The data can be
stored in an external file or defined within the XmlDataSource control
itself. To specify the file that contains the data, set the DataFile property
to the physical or relative path of the file. To embed the data within the
HTML definit... (more)
ASP.NET version 1.0 and 1.1 were giant leaps forward in making data-driven
Web sites easier to create. With only a few lines of code you can create Web
sites that dynamically query and update databases, XML files, and more.
Furthering the goal of making Web development easier, ASP.NET version 2.0
makes even those few lines of code unnecessary, thanks to a new set of server
controls called Data Source controls.
Using the new Data Source controls you can declaratively create a link
between the Web user interface (ASP.NET and HTML controls) and the data used
to populate them. The s... (more)