13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

object <strong>for</strong> <strong>XML</strong>-driven updates, an ADO.<strong>NET</strong> batch update is still an option to considerwhen you're updat<strong>in</strong>g a database start<strong>in</strong>g with <strong>XML</strong> data.The ADO.<strong>NET</strong> batch update is a step-by-step procedure implemented through asequence of <strong>in</strong>dividual statements, all runn<strong>in</strong>g from the client environment. Onceaga<strong>in</strong>, this is different from Updategrams, <strong>in</strong> which all data is downloaded to SQLServer and applied as a server-side batch.The closest you can get to this model with ADO.<strong>NET</strong> is us<strong>in</strong>g a datatier componentthat decouples any middle-tier objects from the database. The middle-tier objectapplies all the needed changes to the DataSet object and then passes the object on toanother component, possibly located on the same mach<strong>in</strong>e as SQL Server. TheDataSet object is remoted as <strong>XML</strong> and is rebuilt at the dest<strong>in</strong>ation. F<strong>in</strong>ally, thechanges are applied <strong>in</strong> batch update mode but through a specialized and scalabledatatier component and with a more effective use of the bandwidth.SQL<strong>XML</strong> Managed ClassesSQL<strong>XML</strong> 3.0 comes with a handful of managed classes designed to expose thefunctionality of SQL<strong>XML</strong> 3.0 <strong>in</strong>side the .<strong>NET</strong> Framework. SQL<strong>XML</strong> managed classesallow you br<strong>in</strong>g <strong>XML</strong> data read from SQL Server <strong>in</strong>to .<strong>NET</strong> Framework applications,process the data, and send any updates back to SQL Server as an ADO.<strong>NET</strong> DiffGram.The managed classes are exposed by the microsoft.data.sqlxml assembly.SQL<strong>XML</strong> does not get along perfectly with the .<strong>NET</strong> Framework data provider <strong>for</strong> SQLServer. SQL<strong>XML</strong> needs to address special <strong>XML</strong>-driven functionalities of SQL Server2000 that the .<strong>NET</strong> Framework data provider simply does not support. As a result, theSQL Server .<strong>NET</strong> Framework provider can handle traditional SQL queries, <strong>in</strong>clud<strong>in</strong>gFOR <strong>XML</strong> queries, but it can't execute <strong>XML</strong> templates (<strong>for</strong> example, Updategrams) orserver-side XPath queries over <strong>XML</strong> views. For this reason, SQL<strong>XML</strong> managed classesrely on the SQL<strong>XML</strong>OLEDB OLE DB provider <strong>for</strong> all of the tasks that <strong>in</strong>volve a SQLServer connection.Figure 8-5 illustrates the key role that the SqlXmlCommand class and itsExecuteStream method play <strong>in</strong> the overall SQL<strong>XML</strong> 3.0 architecture.314

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!