Apply Your Knowledge
Exercises
2.1 - Compiling XPath Expressions
The .NET Framework developers invested a lot of effort in finding ways to make code more efficient. One performance enhancement in evaluating XPath expressions is the capability to precompile an expression for reuse. This exercise shows you how to use the Compile() method of the XPathNavigator class to create a precompiled XPath expression, represented as an XPathExpression object.
Estimated Time: 15 minutes.
-
Create a new Visual C# .NET project to use for the exercises in this chapter.
-
Add a new XML file to the project. Name the new file Books1.xml. Modify the XML for Books1.xml as follows:
<?xml version="1.0" encoding="UTF-8"?> <Books> <Book Pages="1088"> <Author>Delaney, Kalen</Author> <Title> Inside Microsoft SQL Server 2000 </Title> <Publisher>Microsoft Press </Publisher> </Book> <Book Pages="997"> <Author>Burton, Kevin</Author> <Title>.NET Common Language Runtime </Title> <Publisher>Sams</Publisher> </Book> <Book Pages="392"> <Author>Cooper, James W.</Author> <Title>C# Design Patterns</Title> <Publisher>Addison Wesley </Publisher> </Book> </Books>
-
Add a new XML file to the project. Name the new file Books2.xml. Modify the XML for Books2.xml as follows:
<?xml version="1.0" encoding="UTF-8" ?> <Books> <Book Pages="792"> <Author>LaMacchia, Brian A. </Author> <Title>.NET Framework Security </Title> <Publisher>Addison Wesley </Publisher> </Book> <Book Pages="383"> <Author>Bischof Brian</Author> <Title>The .NET Languages: A Quick Translation Guide</Title> <Publisher>Apress</Publisher> </Book> <Book Pages="196"> <Author>Simpson, John E.</Author> <Title>XPath and XPointer</Title> <Publisher>O'Reilly</Publisher> </Book> </Books>
-
Add a new form to the project. Name the new form Exercise2_1.cs.
-
Add a Label control, a TextBox control (txtXPath), a Button control (btnEvaluate), and a ListBox control (lbNodes) to the form.
-
Switch to code view and add the following using directive:
-
using System.Xml.XPath;
-
Double-click the Button control and add code to handle the button's Click event:
private void btnEvaluate_Click( object sender, System.EventArgs e) { // Load the Books1.xml file XPathDocument xpd1 = new XPathDocument( @"..\..\Books1.xml"); // Get the associated navigator XPathNavigator xpn1 = xpd1.CreateNavigator(); // Precompile an XPath expression XPathExpression xpe = xpn1.Compile(txtXPath.Text); // Retrieve nodes to match // the expression XPathNodeIterator xpni = xpn1.Select(xpe); // And dump the results lbNodes.Items.Clear(); lbNodes.Items.Add( "Results from Books1.xml:"); // Load the Books1.xml file while(xpni.MoveNext()) { lbNodes.Items.Add(" " + xpni.Current.NodeType.ToString() + ": " + xpni.Current.Name + " = " + xpni.Current.Value); } // Now get the second document XPathDocument xpd2 = new XPathDocument( @"..\..\Books2.xml"); // Get the associated navigator XPathNavigator xpn2 = xpd2.CreateNavigator(); // Retrieve nodes to match // the expression // Reuse the precompiled expression xpni = xpn2.Select(xpe); // And dump the results lbNodes.Items.Add( "Results from Books2.xml:"); while (xpni.MoveNext()) { lbNodes.Items.Add(" " + xpni.Current.NodeType.ToString() + ": " + xpni.Current.Name + " = " + xpni.Current.Value); } }
-
Insert the Main() method to launch the form. Set the form as the startup form for the project.
-
Run the project. Enter an XPath expression and click the button. The code precompiles the expression and then uses the precompiled version to select nodes from each of the two XML files, as shown in Figure 2.18.
Figure 2.18 The Compile() method of the XPathNavigator class allows you to create a precompiled XPath expression.
2.2 - Creating DiffGrams
If you'd like to experiment with the DiffGram format, you don't have to create DiffGrams by hand. You can use the WriteXml() method of the DataSet object to create a DiffGram containing all the changes made since the DataSet object was initialized. This exercise walks you through the process of creating a DiffGram.
Estimated Time: 15 minutes.
-
Add a new form to the project. Name the new form Exercise2_2.cs.
-
Add a DataGrid control (dgProducts) and a Button control (btnWriteDiffGram) to the form.
-
Expand the Server Explorer tree view to show a Data Connection to the Northwind sample database. Drag and drop the connection to the form.
-
Drag a SaveFileDialog component from the Toolbox and drop it on the form. Set the FileName property of the component to diffgram.xml.
-
Switch to code view and add the following using directive:
using System.Data; using System.Data.SqlClient;
-
Add the following DataSet declaration to the class definition:
DataSet dsProducts = new DataSet();
-
Double-click the form and add the following code to handle the form's Load event:
private void Exercise2_2_Load( object sender, System.EventArgs e) { // Create a command to retrieve data SqlCommand cmd = sqlConnection1.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "SELECT * FROM Products " + "WHERE CategoryID = 6"; // Retrieve the data to the DataSet SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; da.Fill(dsProducts, "Products"); // Bind it to the user interface dgProducts.DataSource = dsProducts; dgProducts.DataMember = "Products"; }
-
Double-click the button and add the following code to handle the button's Click event:
private void btnWriteDiffGram_Click( object sender, System.EventArgs e) { // Prompt for a filename saveFileDialog1.ShowDialog(); // Write out the DiffGram dsProducts.WriteXml( saveFileDialog1.FileName, XmlWriteMode.DiffGram); }
-
Insert the Main() method to launch the form. Set the form as the startup form for the project.
-
Run the project. The form displays records from the Northwind Products table for the selected category ID. Make some changes to the data; you can use the DataGrid to add, edit, or delete records. Click the button and select a name for the DiffGram. Click the Write DiffGram button to create the DiffGram. Open the new DiffGram in a text editor and inspect it to see how your changes are represented.
2.3 - Using XPath with Relational Data
By combining an XML-synchronized DataSet object with an XPath expression, you can use XPath to select information from a relational database. This exercise shows you how you can use a DataSet object, an XmlDataDocument object, and an XPathNavigator object together.
Estimated Time: 25 minutes.
-
Add a new form to the project. Name the new form Exercise2_3.cs.
-
Add two Label controls, two TextBox controls (txtSQLStatement and txtXPath), two Button controls (btnCreateDataSet and btnSelectNodes), and a ListBox control (lbNodes) to the form.
-
Expand the Server Explorer tree view to show a data connection to the Northwind sample database. Drag and drop the connection to the form.
-
Switch to code view and add the following using directives:
using System.Data; using System.Data.SqlClient; using System.Xml; using System.Xml.XPath;
-
Add the following code to the class definition:
DataSet ds; XmlDataDocument xdd;
-
Double-click the Create DataSet button and enter code to load a DataSet object and an XmlDataDocument object:
private void btnCreateDataSet_Click( object sender, System.EventArgs e) { // Create a command to retrieve data SqlCommand cmd = sqlConnection1.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = txtSQLStatement.Text; // Retrieve the data to the DataSet SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; ds = new DataSet(); da.Fill(ds, "Table1"); // Retrieve the XML form of the Dataset xdd = new XmlDataDocument(ds); }
-
Double-click the Select Nodes button and enter code to evaluate the XPath expression:
private void btnSelectNodes_Click( object sender, System.EventArgs e) { // Get the associated navigator XPathNavigator xpn = xdd.CreateNavigator(); // Retrieve nodes to match // the expression XPathNodeIterator xpni = xpn.Select(txtXPath.Text); // And dump the results lbNodes.Items.Clear(); while (xpni.MoveNext()) { lbNodes.Items.Add( xpni.Current.NodeType.ToString() + ": " + xpni.Current.Name + " = " + xpni.Current.Value); } }
-
Insert the Main() method to launch the form. Set the form as the startup form for the project.
-
Run the project. Enter a SQL Statement that retrieves rows and click the first button. Then enter an XPath expression and click the second button. You'll see the XPath query results as a set of XML nodes, as shown in Figure 2.19.
Figure 2.19 You can use XPath with an XmlDataDocument object.
Review Questions
How are XML elements and attributes represented in the DOM?
When should you use an XmlTextReader object by itself rather than with an XmlDocument object?
Explain three ways to synchronize an XmlDataDocument object with a DataSet object.
Why should you use an explicit path rather than a documentwide wildcard in an XPath expression?
What is the difference between the XPath expressions /Customers/Customer/Order[1] and (/Customers/Customer/Order)[1]?
How can you instantiate an XPathNavigator object?
What options are there for validating an XML file with the XmlValidatingReader object?
What are the three main variants of the FOR XML clause in T-SQL?
How can you generate schema information with the FOR XML clause in T-SQL?
What data operations can be represented in a DiffGram?
Exam Questions
-
Your application contains an XML file, Orders.xml, with the following content:
<?xml version="1.0" encoding="utf-8" ?> <Orders> <Order OrderID="1"> <OrderDate>1/1/2003</OrderDate> </Order> <Order OrderID="2"> <OrderDate>1/2/2003</OrderDate> </Order> <Order OrderID="3"> <OrderDate>1/3/2003</OrderDate> </Order> </Orders>
Your application also contains a form with a Button control named btnProcess and a ListBox control named lbNodes. The Click event handler for the Button control has this code:
private void btnProcess_Click( object sender, System.EventArgs e) { XmlTextReader xtr = new XmlTextReader(@"..\..\Orders.xml"); while(xtr.Read()) { if ((xtr.NodeType == XmlNodeType.Attribute) || (xtr.NodeType == XmlNodeType.Element) || (xtr.NodeType == XmlNodeType.Text)) { if(xtr.HasValue) lbNodes.Items.Add(xtr.Value); } } xtr.Close(); }
What will be the contents of the ListBox control after you click the button?
-
1 1/1/2003 2 1/2/2003 3 1/3/2003
-
1 2 3
-
Orders Order 1/1/2003 Order 1/2/2003 Order 1/3/2003
-
1/1/2003 1/2/2003 1/3/2003
-
-
Your application contains the following XML file:
<?xml version="1.0" encoding="utf-8" ?> <Orders> <Order OrderID="1"> <OrderDate>1/1/2003</OrderDate> </Order> <Order OrderID="2"> <OrderDate>1/2/2003</OrderDate> </Order> <Order OrderID="3"> <OrderDate>1/3/2003</OrderDate> </Order> </Orders>
Your application uses the ReadXmlSchema() method of the DataSet object to create a DataSet object with an appropriate schema for this XML file. Which of the following mappings between XML entities and DataSet object entities will this method create?
-
Orders and Order will become DataTable objects. OrderID will become a DataColumn object. OrderDate will not be mapped.
-
Orders and Order will become DataTable objects. OrderID and OrderDate will become DataColumn objects.
-
Orders and Order will become DataTable objects. OrderDate will become a DataColumn. OrderID will not be mapped.
-
Orders will become a DataTable. Order and OrderDate will become DataColumn objects.
-
Your application includes an XML file that represents inventory in a warehouse. Each inventory item is identified by 50 different elements. You need to work with 4 of these elements on a DataGrid control. You plan to create a DataSet object containing the appropriate data that can be bound to the DataGrid control. How should you proceed?
-
Load the XML file into an XmlDocument object. Create a DataSet object containing a single DataTable object with the desired column. Write code that loops through the nodes in the XmlDocument object and that transfers the data from the appropriate nodes to the DataSet object.
-
Load the XML file into an XmlDataDocument object. Retrieve the DataSet object from the XmlDataDocument object's DataSet property.
-
Load the XML file into a DataSet object by calling the DataSet object's ReadXml() method.
-
Create a schema that includes the four required elements. Create a DataSet object from this schema. Create an XmlDataDocument object from the DataSet object. Load the XML document into the XmlDataDocument object.
-
-
You use a SqlDataAdapter object to fill a DataSet object with the contents of the Customers table in your database. The CompanyName of the first customer is "Biggs Industries". You synchronize an XmlDataDocument object with the DataSet object. In the DataSet object, you change the CompanyName of the first customer to "Biggs Limited". After that, in the XmlDataDocument, you change the value of the corresponding node to "Biggs Co." When you call the Update() method of the SqlDataAdapter object, what is the effect?
-
The CompanyName in the database remains "Biggs Industries".
-
The CompanyName in the database is changed to "Biggs Limited".
-
The CompanyName in the database is changed to "Biggs Co."
-
A record locking error is thrown.
-
-
Your application contains the following XML file:
<?xml version="1.0" encoding="utf-8" ?> <Customers> <Customer> <CustomerName>A Company</CustomerName> <Orders> <Order OrderID="1"> <OrderDate>1/1/2003</OrderDate> </Order> <Order OrderID="2"> <OrderDate>1/2/2003</OrderDate> </Order> </Orders> </Customer> <Customer> <CustomerName>B Company</CustomerName> <Orders> <Order OrderID="3"> <OrderDate>1/2/2003</OrderDate> </Order> <Order OrderID="4"> <OrderDate>1/3/2003</OrderDate> </Order> </Orders> </Customer> <Customer> <CustomerName>C Company</CustomerName> <Orders> <Order OrderID="5"> <OrderDate>1/4/2003</OrderDate> </Order> <Order OrderID="6"> <OrderDate>1/5/2003</OrderDate> </Order> </Orders> </Customer> </Customers>
Which XPath expression will return the first OrderID for each customer?
-
/Customers/Customer/Orders/Order/@OrderID[1]
-
(/Customers/Customer/Orders/Order)[1]/@OrderID
-
/Customers/Customer/Orders/Order[1]/@OrderID
-
(/Customers/Customer/Orders/Order/@OrderID)[1]
-
Your application contains the following XML file:
<?xml version="1.0" encoding="utf-8" ?> <Customers> <Customer> <CustomerName>A Company</CustomerName> <Orders> <Order OrderID="1"> <OrderDate>1/1/2003</OrderDate> </Order> <Order OrderID="2"> <OrderDate>1/2/2003</OrderDate> </Order> </Orders> </Customer> <Customer> <CustomerName>B Company</CustomerName> <Orders> <Order OrderID="3"> <OrderDate>1/2/2003</OrderDate> </Order> <Order OrderID="4"> <OrderDate>1/3/2003</OrderDate> </Order> </Orders> </Customer> <Customer> <CustomerName>C Company</CustomerName> <Orders> <Order OrderID="5"> <OrderDate>1/4/2003</OrderDate> </Order> <Order OrderID="6"> <OrderDate>1/5/2003</OrderDate> </Order> </Orders> </Customer> </Customers>
Which XPath expression will return the CustomerName for all customers who placed an order on 1/3/2003?
-
/Customers/Customer[./Orders/Order/OrderDate="1/3/2003"]/CustomerName
-
/Customers/Customer[/Orders/Order/OrderDate="1/3/2003"]/CustomerName
-
/Customers/Customer[//Orders/Order/OrderDate="1/3/2003"]/CustomerName
-
/Customers/Customer[Orders/Order/OrderDate="1/3/2003"]/CustomerName
-
Your application allows the user to perform arbitrary XPath queries on an XML document. The user does not need to be able to alter the document. Which approach will give you the maximum performance for these requirements?
-
Read the document into an XmlDocument object. Use the CreateNavigator() method of the XmlDocument object to return an XPathNavigator object. Perform your queries by using the XPathNavigator object.
-
Read the document into an XmlDataDocument object. Use the DataSet property of the XmlDataDocument object to return a DataSet object. Perform your queries by using the DataSet object.
-
Read the document into an XmlDataDocument object. Use the CreateNavigator() method of the XmlDataDocument object to return an XPathNavigator object. Perform your queries by using the XPathNavigator object.
-
Read the document into an XPathDocument object. Use the CreateNavigator() method of the XPathDocument object to return an XPathNavigator object. Perform your queries by using the XPathNavigator object.
-
-
You are designing an application that will enable the user to explore the structure of an XML file. You need to allow the user to move to the parent node, next node, or first child node from the current node. Which object should you use to implement this requirement?
-
XPathNavigator
-
XmlReader
-
XmlTextReader
-
XPathExpression
-
-
Your XML document has an inline schema. What is the minimum number of errors that this document will generate if you validate it with the XmlValidatingReader class?
-
0
-
1
-
2
-
3
-
-
You are retrieving customer data from a SQL Server database into an XML document. You want the CustomerName and ContactName columns to be translated into XML elements. Which clause should you use in your SQL statement?
-
FOR XML AUTO
-
FOR XML RAW
-
FOR XML EXPLICIT
-
FOR XML AUTO, XMLDATA
-
-
Your application contains the following code:
private void btnReadXML_Click( object sender, System.EventArgs e) { // Create a command to retrieve XML SqlCommand sc = SqlConnection1.CreateCommand(); sc.CommandType = SqlCommandType.Text; sc.CommandText = "SELECT Customers.CustomerID, " + "Customers.CompanyName," + "Orders.OrderID, Orders.OrderDate " + "FROM Customers INNER JOIN Orders " + "ON Customers.CustomerID = " + "Orders.CustomerID " + "WHERE Country = 'Brazil' AND " + "OrderDate BETWEEN '1997-03-15' " + "AND '1997-04-15' " + "FOR XML AUTO, ELEMENTS"; // Read the XML into an XmlReader XmlReader xr = sc.ExecuteXmlReader(); XmlDocument xd = new XmlDocument(); xd.Load(xr); }
When you run this code, you receive an error on the line of code that attempts to load the XmlDocument. What can you do to fix the problem?
-
Use FOR XML RAW instead of FOR XML AUTO in the SQL statement.
-
Replace the XmlDocument object with an XmlDataDocument object.
-
Replace the SqlCommand object with a SqlXmlCommand object.
-
Replace the XmlReader object with an XmlTextReader object.
-
Your application contains the following code, which uses the SQLXML managed classes to apply a DiffGram to a SQL Server database:
private void btnUpdate_Click( object sender, System.EventArgs e) { // Connect to the SQL Server database SqlXmlCommand sxc = new SqlXmlCommand( "Provider=SQLOLEDB;" + "Server=(local);database=Northwind;" + "Integrated Security=SSPI"); // Set up the DiffGram sxc.CommandType = SqlXmlCommandType.DiffGram; FileStream fs = new FileStream(@"..\..\diffgram.xml", FileMode.Open); sxc.CommandStream = fs; // And execute it sxc.ExecuteNonQuery(); MessageBox.Show( "Database was updated!"); }
When you run the code, it does not update the database. The DiffGram is properly formatted. What should you do to correct this problem?
-
Use a SqlCommand object in place of the SqlXmlCommand object.
-
Supply an appropriate schema mapping file for the DiffGram.
-
Store the text of the DiffGram in the CommandText property of the SqlXmlCommand object.
-
Use a SqlConnection object to make the initial connection to the database.
-
Which of these operations can be carried out in a SQL Server database by sending a properly-formatted DiffGram to the database? (Select two.)
-
Adding a row to a table
-
Adding a primary key to a table
-
Deleting a row from a table
-
Changing the data type of a column
-
-
You are developing code that uses the XPathNavigator object to navigate among the nodes in the DOM representation of an XML document. The current node of the XPathNavigator is an element in the XML document that does not have any attributes or any children. You call the MoveToFirstChild() method of the XPathNavigator object. What is the result?
-
The current node remains unchanged and there is no error.
-
The current node remains unchanged and a runtime error is thrown.
-
The next sibling of the current node becomes the current node and there is no error.
-
The next sibling of the current node becomes the current node and a runtime error is thrown.
-
-
Which of these operations requires you to have an XML schema file?
-
Updating a SQL Server database with a DiffGram through the SQLXML Managed classes
-
Validating an XML file with the XmlValidatingReader class
-
Performing an XPath query with the XPathNavigator class
-
Reading an XML file with the XmlTextReader class
-
Answers to Review Questions
-
XML elements are represented as nodes within the DOM. XML attributes are represented as properties of their parent nodes.
-
The XmlTextReader object provides forward-only, read-only access to XML data. For random access or for read-write access you should use the XmlDocument class or one of its derived classes.
-
You can synchronize an XmlDataDocument object and a DataSet object by creating a DataSet object from an XmlDataDocument object, by creating an XmlDataDocument object from a DataSet object, or by creating both a DataSet object and an XmlDataDocument object from a schema.
-
XPath expressions containing an explicit path, such as /Customers/Customer/Order/OrderID, are faster to evaluate than documentwide wildcard expressions such as //OrderID.
-
/Customers/Customer/Order[1] selects the first order for each customer, whereas (/Customers/Customer/Order)[1] selects the first order in the entire document.
-
You can instantiate an XPathNavigator object by calling the CreateNavigator() method of the XmlDocument, XmlDataDocument, or XPathDocument classes.
-
You can use an XmlValidatingReader object to validate an XML file for conformance with an embedded schema, an XSD file, a DTD file, or an XDR file.
-
The three main variants of FOR XML are FOR XML RAW, FOR XML AUTO, and FOR XML EXPLICIT.
-
To include schema information with a FOR XML query, specify the XMLDATA option.
-
DiffGrams can represent insertions, deletions, and modifications of the data in a DataSet object or SQL Server database.
Answers to Exam Questions
-
D. When you read XML data with the help of XmlReader or its derived classes, nodes are not included for XML attributes, but only for XML elements and the text that they contain. XML element nodes do not have a value. The only text that will be printed out is the value of the text nodes within the OrderDate elements. For more information, see the section "Accessing an XML File" in this chapter.
-
B. The ReadXmlSchema() method maps nested elements in the XML file to related DataTable objects in the DataSet object. At the leaf level of the DOM tree, both elements and attributes are mapped to DataColumn objects. For more information, see the section "Synchronizing DataSet Objects with XML" in this chapter.
-
D. Looping through all the nodes in an XmlDocument object is comparatively slow. If you start with the full XML document or by calling the ReadXml() method of the DataSet object, the DataSet object will contain all 50 elements. Using a schema file enables you to limit the DataSet object to holding only the desired data. For more information, see the section "Synchronizing DataSet Objects with XML" in this chapter.
-
C. The DataSet and the XmlDataDocument objects represent two different views of the same data structure. The last change made to either view is the change that is written back to the database. For more information, see the section "Synchronizing DataSet Objects with XML" in this chapter.
-
C. /Customers/Customer/Orders/Order/@OrderID[1] selects the first OrderID for each order. (/Customers/Customer/Orders/Order)[1]/ @OrderID selects the OrderID for the first order in the entire file. (/Customers/Customer/Orders/Order/@OrderID)[1] selects the first OrderID in the entire file. The remaining choice is the correct one. For more information, see the section "Understanding XPath" in this chapter.
-
A. The filtering expression needs to start with the ./ operator to indicate that it is filtering nodes under the current node at that point in the expression. For more information, see the section "Understanding XPath" in this chapter.
-
D. The XPathDocument class is optimized for read-only XPath queries. For more information, see the section "Understanding XPath" in this chapter.
-
A. The XPathNavigator object provides random access movement within the DOM. The XmlReader and XmlTextReader objects provide forward-only movement. The XPathExpression object is useful for retrieving a set of nodes, but not for navigating between nodes. For more information, see the section "Using the XPathNavigator Class" in this chapter.
-
B. An inline schema cannot contain validation information for the root node of the document, so XML documents with inline schemas will always have at least one validation error. For more information, see the section "Using an XSD Schema" in this chapter.
-
C. The raw and auto modes of the FOR XML statement always map columns to attributes, if the ELEMENTS option is not added in the FOR XML clause. Only explicit mode can map a column to an element. For more information, see the section "Understanding the FOR XML Clause" in this chapter.
-
C. The SqlCommand.ExecuteXmlReader() method returns an XML fragment rather than an XML document. To load a complete and valid XML document, you need to use the SqlXmlCommand object (from the SQLXML Managed Classes) instead. For more information, see the section "Updating SQL Data by Using XML" in this chapter.
-
B. When executing a DiffGram via the SQLXML managed classes, you must supply a mapping schema file. Otherwise, the code doesn't know which elements in the DiffGram map to which columns in the database. For more information, see the section "Using DiffGrams" in this chapter.
-
A, C. DiffGrams are useful for performing data manipulation operations, but not for data definition operations. For more information, see the section "Using DiffGrams" in this chapter.
-
A. The MoveTo methods of the XPathNavigator object always execute without error. If the requested move cannot be performed, the current node remains unchanged and the method returns false. For more information, see the section "Using the XPathNavigator Class" in this chapter.
-
A. You cannot perform a DiffGram update without a schema file that specifies the mapping between XML elements and database columns. Validation can be performed with a DTD or XDR file instead of a schema. XPath queries and reading XML files do not require a schema. For more information, see the section "Using DiffGrams" in this chapter.
Suggested Readings and Resources
-
Visual Studio .NET Combined Help Collection
-
Employing XML in the .NET Framework
-
XML and the DataSet
-
-
Microsoft SQL Server Books Online
-
Retrieving XML Documents Using FOR XML
-
SELECT Statement
-
-
.NET Framework QuickStart Tutorials, Common Tasks QuickStart, XML section.
-
Mike Gunderloy. ADO and ADO.NET Programming. Sybex, 2002.
-
John E. Simpson. XPath and XPointer. O'Reilly, 2002.
-
John Griffin. XML and SQL Server. New Riders, 2001.