Click here to Skip to main content
15,909,747 members
Home / Discussions / Database
   

Database

 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
falbala12-Oct-03 0:27
falbala12-Oct-03 0:27 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
Wjousts30-Sep-03 9:05
Wjousts30-Sep-03 9:05 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 records. Pin
falbala12-Oct-03 0:29
falbala12-Oct-03 0:29 
Generalbatch Pin
sardinka26-Sep-03 5:04
sardinka26-Sep-03 5:04 
GeneralRe: batch Pin
Anonymous26-Sep-03 11:34
Anonymous26-Sep-03 11:34 
GeneralSQL Server Yukon Pin
nevhile.net26-Sep-03 1:20
nevhile.net26-Sep-03 1:20 
GeneralRe: SQL Server Yukon Pin
Mike Dimmick26-Sep-03 3:25
Mike Dimmick26-Sep-03 3:25 
GeneralDisplay XSLT transformed XMLDataDocument from FOR XML EXPLICIT query in SQL Server 2000 Pin
drikusr25-Sep-03 20:39
drikusr25-Sep-03 20:39 
Hello folks, I have been traversing the net for information on this particular thing I want to have happen:

1. Execute a FROM XML EXPLICIT SQL Server 2000 query to get an XML document, which lists users per role, eg.
<Role role_id="1" role_name="administrator">
  <User user_id="1" user_login="admin"/>
  <User user_id="2" user_login="drikusr"/>
</Role>

2. This result is read into a Dataset (C#), eg.
objXMLReader = (XmlTextReader)objCommand.ExecuteXmlReader();
objDataSet.ReadXml(objXMLReader, XmlReadMode.InferSchema);

3.I seem able to easily manipulate the dataset when employing the following code:
strXmlDocument = (objDataSet.GetXml());
this.xmlObject.Document.LoadXml(strXmlDocument);
Which enables the XML document to be read into a string variable, ie. strXmlDocument

On the other hand, synchronizing the Dataset with an XMLDataDocument, eg.
xmlDoc = new XmlDataDocument(objDataSet); and loading a transformation, eg. 
XslTransform xslTran = new XslTransform();
xslTran.Load(xsltPath);

upon which the following code is executed:

//====[XmlTextWriter XSLT Output Capture]===================================
//-- Create a string to write the transformed xml to
stringWriter = new StringWriter();
xmlWriter = new XmlTextWriter(stringWriter); 

//-- Apply formatting
xmlWriter.Formatting = Formatting.Indented;
xmlWriter.Indentation = 2;
	
//-- Perform the XML transformation
xslTran.Transform(xmlDoc,null,xmlWriter,null);

//-- Data binding
this.txtFormattedXML.Text = stringWriter.ToString();

stringWriter.Close();
xmlWriter.Close();
//====[END]===================================

returns an XSLT processed XML document, but with the actual data missing, which was read from the database.

For example:

The first set of commands produce this XML document that has the Role data included:
<?xml version='1.0' encoding='utf-8'?>
<NewDataSet><Role role_id="1" role_name="administrator">
  <User user_id="1" user_login="admin"></User>
  <User user_id="2" user_login="drikusr"></User>
</Role></NewDataSet>


The XMLDataDocument and XSLT transform (with missing data) results in:
<html xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <head>
    <link rel="stylesheet" href="css_stylesheets/netLc_Styles.css" />
  </head>
  <body>
  </body>
</html>


Has anyone done an end-to-end FOR XML EXPLICIT to ADO.Net solution and hence manipulated the XML (all in memory) displaying it on the UI and getting back changes which are written to the Database by ADO.Net?

All the examples on the net keep stuffing around with XML documents located on the file system and every single "FOR XML EXPLICIT" and ADO.Net example (usually the same one re-hashed on different sites Eek! | :eek: ) stop short at the Dataset, with no client rendering.

As you might be able to tell, I don't have a lot of .Net experience, so I may be overlooking the obvious.

Smile | :) Your help is appreciated!

Regards
Drikus
GeneralRe: Display XSLT transformed XMLDataDocument from FOR XML EXPLICIT query in SQL Server 2000 Pin
drikusr29-Sep-03 17:11
drikusr29-Sep-03 17:11 
GeneralUpdating DataTable that has an expression column Pin
Dr_Sh0ck25-Sep-03 15:41
Dr_Sh0ck25-Sep-03 15:41 
GeneralRe: Updating DataTable that has an expression column Pin
Guillermo Rivero29-Sep-03 12:12
Guillermo Rivero29-Sep-03 12:12 
GeneralRe: Updating DataTable that has an expression column Pin
Member 79899372-Oct-03 21:51
Member 79899372-Oct-03 21:51 
GeneralUsing CASE..END in OPENXML Pin
mittalpa25-Sep-03 11:54
mittalpa25-Sep-03 11:54 
GeneralSQL Server 2000 Sleeping Processes Pin
bsandell25-Sep-03 8:16
bsandell25-Sep-03 8:16 
GeneralSQL Case Sensitivity Pin
deanoA25-Sep-03 3:29
deanoA25-Sep-03 3:29 
GeneralRe: SQL Case Sensitivity Pin
Anonymous25-Sep-03 11:22
Anonymous25-Sep-03 11:22 
GeneralRe: SQL Case Sensitivity Pin
Mike Dimmick26-Sep-03 3:45
Mike Dimmick26-Sep-03 3:45 
GeneralYet another MySQL string issue. Pin
MKlucher24-Sep-03 8:03
MKlucher24-Sep-03 8:03 
GeneralRe: Yet another MySQL string issue. Pin
Anonymous24-Sep-03 16:16
Anonymous24-Sep-03 16:16 
GeneralRe: Yet another MySQL string issue. Pin
ZoogieZork24-Sep-03 17:14
ZoogieZork24-Sep-03 17:14 
QuestionHow to cancel insert in the MSdatagrid control? Pin
korgan23-Sep-03 22:43
korgan23-Sep-03 22:43 
QuestionHow to get the current selected row in DataGrid? Pin
EastDragon23-Sep-03 21:43
EastDragon23-Sep-03 21:43 
AnswerRe: How to get the current selected row in DataGrid? Pin
Guillermo Rivero29-Sep-03 8:24
Guillermo Rivero29-Sep-03 8:24 
GeneralADO.Net Books Pin
dbetting23-Sep-03 18:08
dbetting23-Sep-03 18:08 
GeneralRe: ADO.Net Books Pin
Braulio Dez24-Sep-03 3:46
Braulio Dez24-Sep-03 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.