DataSet.WriteXml

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi,
I have a stored procedure with a query

SELECT
DR_EmployeeView.emp_id,
DR_EmployeeView.emp_sme_id_1 as [emp_sme_id],
DR_EmployeeView.emp_sme_id_2 as [emp_sme_id]
FROM DR_EmployeeView

I need my xml looks like this (with 2 same elements, emp_sme_id):
<nc_employee>

<emp_id>00000026</emp_id>

<emp_sme_id> abc</emp_sme_id>

<emp_sme_id> def</emp_sme_id>

</nc_employee>



When I use Dataset.WriteXml, it looks like this:


<nc_employee>

<emp_id>00000026</emp_id>



<emp_sme_id> abc</emp_sme_id>

<emp_sme_id1> def</emp_sme_id1>

</nc_employee>

It automatically added 1 to the second element of .emp_sme_id.

Please help. Thanks.






.



Relevant Pages

  • Problems getting all the data back with a XML query
    ... The function and the Stored procedure works fine and returns the XML, ... If i run the query in the query analyser with the csv parameter and no FOR ... VS2003, SQLXML sp2, XPpro sp2 ...
    (microsoft.public.sqlserver.xml)
  • Re: Nada
    ... It still didn't fix the problem but caused me to look more closely at the query. ... > The reason I got no XML back was because in the query I had the stored procedure name as sp100pamenu_select when it is in fact sp100pamenus_select. ... > I think that the stream should report some sort of error in this situation Rather than just giving no xml back it would be nice if the ADO responded by giving an error stating that the procedure does not exist in the database. ... Does anyone have an example of an ADO stream with error handling built in? ...
    (microsoft.public.sqlserver.xml)
  • Q: on stored procedure
    ... In a stored procedure I've a WHERE condition which asks for the following ... When I run the query, the window comes up with D_END and then with D_Start. ... Prev by Date: ...
    (microsoft.public.sqlserver.datamining)
  • Re: Query results to file
    ... I ALREADY have XML which is output from the stored procedure in a column. ... So I guess I need some kind of stream object from this column that contains ... I want to execute this query and write the results to a file. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: What is the "@" for?
    ... where you got that query from? ... I bet it was from a stored procedure, if that is so you cannot use it from ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)