GeekArticles
Database
SQL ServerWorking with XML Data Using LINQ, a TreeView, and a ListView :: Editing Data
Author: aspnet.4guysfromrolla.com |
Published: 30th Apr 2008 |
Visited: 94 times |
Add CommentFiled in: SQL Server
ASP.NET includes a variety of tools for displaying and editing XML documents. A previous article, Working
with XML Data Using LINQ, a TreeView, and a ListView :: Displaying Data, showed how with a TreeView control, a ListView control, an XmlDataSource control,
a LinqDataSource control, and about 50 lines of code we could create a web page that displayed the contents of a hierarchical XML file. Specifically,
the page displayed the contents from a fictional employee phonebook, which allowed for an arbitrary number of employees nested within branches and
departments. The TreeView and XmlDataSource controls displayed the various branches and departments, while the ListView and LinqDataSource controls
displayed the employees belonging to the selected branch or department (or one of its subdepartments).
In addition to displaying data, the ListView and LinqDataSource controls can be augmented to edit, insert, and delete data. This article examines how
to update the ListView and code to enable the visitor to add, edit, and delete employee phone records. By the conclusion of this article we will have
constructed a web page that displays XML data and enables an end user to modify the data from a simple, easy-to-use web page interface. Read on to
learn more!
Read More >
Read Article Sponsored Links
Related Articles
• Swing Extreme Testing - The Data Validation Test The Data Validation Test
The Ok button of the SaveAsDialog should only be enabled if the name that has been entered is valid. A name can be invalid if it contains an illegal character, or if it has already been use ...
• Retrieving XML Data Retrieving XML DataTo retrieve XML data from an XMLType table, you can use a SELECT SQL statement, just as you would if you had to query a relational table. For example, to select the employee with the id set to 100 from the employees XMLType table discussed in the preceding section, you might issue ...
• Querying Data with Oracle XQuery Querying Data with Oracle XQuery
Starting with Oracle Database 10g Release 2, you can take advantage of a full-featured native XQuery engine integrated with the database. With Oracle XQuery, you can accomplish various tasks involved in developing PHP/Oracle XML applications, operating on any kind of ...
• Breaking up XML into Relational Data Breaking up XML into Relational Data
While the preceding example shows how to construct an XML representation over relational data, the example in this section illustrates how you can shred XML data back into relational data. This reverse operation can be useful if your application works with relati ...
• Accessing and Updating Data in ASP.NET 2.0: Using Optimistic Concurrency
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 compu ...