Creating and Managing Microsoft Windows Services, Serviced Components, .NET Remoting Objects, and XML Web Services

‚   ‚  


Consuming and Manipulating Data

Access and manipulate data from a Microsoft SQL Server database by creating and using ad hoc queries and stored procedures

  • Transact-SQL is the Microsoft SQL Server dialect of the ANSI SQL-92 standard query language.

  • You can execute T-SQL statements from a variety of interfaces, including the Visual Studio .NET IDE, osql, SQL Query Analyzer, or custom applications.

  • SELECT statements retrieve data from tables in a database.

  • INSERT statements add new data to tables in a database.

  • UPDATE statements modify existing data in tables in a database.

  • DELETE statements remove data from tables in a database.

  • Stored procedures provide a way to keep compiled SQL statements on the database server.

  • The ADO.NET SqlCommand object lets you execute stored procedures.

  • Stored procedures can have both input and output parameters. Input parameters are variables that are used by the stored procedure. Output parameters let the stored procedure return results to the caller.

  • The @@IDENTITY variable returns the most recent identity value from the connection.

Create and manipulate DataSets

Manipulate a DataSet schema
  • DataSet schema files represent the metadata that describes the allowable content of a DataSet.

  • You can create a DataSet schema file from scratch by dragging and dropping elements and attributes within the DataSet schema designer.

  • Simple types allow you to apply constraints to the data that will be allowed in a DataSet.

  • You can quickly create a DataSet schema to represent an existing table by dragging and dropping the table from Server Explorer to the DataSet schema designer.

Manipulate DataSet relationships
  • To create a primary key or a unique key in a DataSet schema, drag and drop the key tool from the toolbox to an XML element.

  • To create a one-to-many relationship, drag and drop the relation tool from the toolbox to the child table of the relationship.

  • To create a nested relationship, drag and drop the child table to the parent table.

Create a strongly typed DataSet
  • A strongly typed DataSet brings the benefits of early binding to your data access code.

  • You can create a strongly typed DataSet by using the component designer with components dragged from Server Explorer or by building a DataSet schema file.

  • When you're working with a strongly typed DataSet in code, IntelliSense will show you the names of the tables and columns contained within the DataSet.

Access and manipulate XML data

Access an XML file by using the Document Object Model (DOM) and an XmlReader
  • The Document Object Model (DOM) is a W3C standard for representing the information contained in an HTML or XML document as a tree of nodes.

  • The XmlReader class defines an interface for reading XML documents. The XmlTextReader class inherits from the XmlReader class to read XML documents from streams.

  • The XmlNode object can be used to represent a single node in the DOM.

  • The XmlDocument object represents an entire XML document.

Transform DataSet data into XML data
  • The XmlDataDocument class is a subclass of the XmlDocument class that can be synchronized with a DataSet.

  • You can start the synchronization process with the XmlDataDocument or with the DataSet, or you can use a schema file to construct both objects.

  • Changes to one synchronized object are automatically reflected in the other.

  • You can use an XmlTextWriter object to persist an XmlDocument object back to disk.

Use XPath to query XML data
  • XPath is a language for specifying or selecting parts of an XML document. XPath is a query language for XML.

  • An XPath expression returns a set of zero or more nodes from the DOM representation of an XML document.

  • The SelectNodes method of the XmlDocument object returns a set of nodes selected by an XPath expression.

  • The XPathDocument and XPathNavigator objects are optimized for fast execution of XPath queries.

  • The XpathNavigator object allows random-access navigation of the structure of an XML document.

Generate and use an XSD schema
  • You can extract an inline schema from an XML file by using the ReadXmlSchema method of the DataSet class.

  • You can infer a schema from the structure of an XML file by using the InferXmlSchema method of the DataSet class.

Write a SQL statement that retrieves XML data from a SQL Server database
  • The FOR XML clause in the SQL Server SELECT statement lets you generate XML documents directly from SQL Server data.

  • By choosing appropriate options in FOR XML , you can map SQL Server columns as either attributes or elements in the generated XML. You can also choose whether to Base64 encode binary columns and whether to embed schema information.

  • You can use the ExecuteXmlReader method of the SqlCommand object to retrieve XML from a SQL Server database and assign it to classes within the .NET Framework.

Update a SQL Server database by using XML
  • The SQLXML package contains XML- related updates for SQL Server 2000.

  • You can use DiffGrams to package updates to SQL Server tables as XML files. The SqlXmlCommand object can apply DiffGrams to a SQL Server database.

Validate an XML document
  • You can validate an XML document for conformance with an inline schema, an external schema, a DTD, or an XDR file by using the XmlValidatingReader class.


‚   ‚  
Top


MCAD. MCSD Training Guide (Exam 70-310. Developing XML Web Services and Server Components with Visual Basic. NET and the. NET Framework)
MCAD/MCSD Training Guide (70-310): Developing XML Web Services and Server Components with Visual Basic(R) .NET and the .NET Framework
ISBN: 0789728206
EAN: 2147483647
Year: 2002
Pages: 166

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net