.NETGURU
No subject given
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngxml' list.


renevazquez@cimex.com.cu
Hi, I have a dataset that have two tables RMA and RMADetails wich is a
child of the first one.

In the dataset I create a datarelation and put the nested property to
true.

I have fill the dataset with the two data adapters and I want to send
the xml to the browser but in a way that the details are nested inside
the RMA element.

I use this code to obtain the xml inside the dataset:

public String GetRMAXML()
{
Data.Namespace = "";
return Data.GetXml();
}

I wish to know why my data didn't output in the nested way.

this is how I get the xml:

<dsRMA>
<Table>
<RMAId>4</RMAId>
<descr>test</descr>
<configNo>1</configNo>
<serialNo>1</serialNo>
<userId>rene</userId>
<saleOrdNo>1</saleOrdNo>
</Table>
<Table>
<RMAId>4</RMAId>
<partNo>x1</partNo>
<qtty>1</qtty>
<failId>1</failId>
<repairId>1</repairId>
</Table>
<Table>
<RMAId>4</RMAId>
<partNo>x2</partNo>
<qtty>2</qtty>
<failId>1</failId>
<repairId>1</repairId>
</Table>
</dsRMA>
</xml>

Reply to this message...
 
    
renevazquez@cimex.com.cu
Hi, I wish to know if someone could show me a complete sample of how
to send xml from the client (in this case the xml inside a dataisland)
to the server and take this xml in the server and asign it to a dom
object, because I have tested a solution and did not work for me.

Any help would be extremely apreciated because I am trying to find out
this for more than a week..

thanks a lot.

this is the code that not work in my case.

**client side code that send the content of my dataisland to the
server:

function SendPart()
{
var xmldoc = new ActiveXObject("MSXML2.DOMDocument"); >
xmldoc = dsoPart.XMLDocument;
var poster = new ActiveXObject("Msxml2.XMLHTTP"); >
poster.Open("POST", "GetXML.aspx", false);
poster.Send(xmldoc);
alert ("ya");
}

**the page that I supose receive the xml:

aspx:

<%@ Page language="c#" Codebehind="GetXML.aspx.cs" >
AutoEventWireup="false" Inherits="Web.GetXML" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>GetXML</title>
<meta name="GENERATOR" Content="Microsoft Visual
Studio > 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript"
content="JavaScript"> > <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5";> >
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="GetXML" method="post" runat="server"> >
</form>

<%=processXML%>

</body>
</HTML>

code behind:
[Original message clipped]

editor.
[Original message clipped]

Reply to this message...
 
    
renevazquez@cimex.com.cu
-- Moved from [aspngfreeforall] to [aspngxml] by Tony Stark <Click here to reveal e-mail address> --

Hi, I wish to know if someone could show me a complete sample of how
to send xml from the client (in this case the xml inside a dataisland)
to the server and take this xml in the server and asign it to a dom
object, because I have tested a solution and did not work for me.

Any help would be extremely apreciated because I am trying to find out
this for more than a week..

thanks a lot.

this is the code that not work in my case.

**client side code that send the content of my dataisland to the
server:

function SendPart()
{
var xmldoc = new ActiveXObject("MSXML2.DOMDocument"); >
xmldoc = dsoPart.XMLDocument;
var poster = new ActiveXObject("Msxml2.XMLHTTP"); >
poster.Open("POST", "GetXML.aspx", false);
poster.Send(xmldoc);
alert ("ya");
}

**the page that I supose receive the xml:

aspx:

<%@ Page language="c#" Codebehind="GetXML.aspx.cs" >
AutoEventWireup="false" Inherits="Web.GetXML" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>GetXML</title>
<meta name="GENERATOR" Content="Microsoft Visual
Studio > 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript"
content="JavaScript"> > <meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5";> >
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="GetXML" method="post" runat="server"> >
</form>

<%=processXML%>

</body>
</HTML>

code behind:
[Original message clipped]

editor.
[Original message clipped]

Reply to this message...
 
    
Kirk Allen Evans
[Original message clipped]

Here is a really simple example using VB... it is easy enough to convert it
to C#. In page 1:

<%@ Page Language="vb"%>
<%@ import namespace="System.Xml"%>

<script language=vb runat=server>
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
        Dim doc As XmlDocument = New XmlDocument()

        Response.ContentType = "text/xml"
        Try
            doc.Load(Request.InputStream)
        Catch oops As Exception
            Dim node As XmlNode = doc.AppendChild(doc.CreateElement("newroot"))
            node = node.AppendChild(doc.CreateTextNode(oops.ToString()))
        End Try
        Dim writer As XmlTextWriter = New XmlTextWriter(Response.OutputStream,
System.Text.Encoding.UTF8)
        doc.WriteContentTo(writer)
        writer.Flush()
        writer.Close()
    End Sub
</script>

In the client code (likely another page, since Page 1 does its work in
Page_Load):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <title>XMLHTTP Testing in .NET</title>
        <xml id="dsoPart">
            <root>
                <child id="1">Testing a data island</child>
                <child id="2">Another test node</child>
            </root>
        </xml>
    </HEAD>
    <body>
        <script language="javascript">
            function SendXML()
            {
                var xmldoc = new ActiveXObject("MSXML2.DOMDocument");
                xmldoc = dsoPart.XMLDocument;
                var poster = new ActiveXObject("Msxml2.XMLHTTP");
                poster.Open("POST", "WebForm2.aspx", false);
                poster.Send(xmldoc.xml);
                alert(poster.ResponseXML.xml);
                alert("ya!");
            }
        </script>
        <form>
            <input type="button" onclick="JavaScript:SendXML();">
        </form>
    </body>
</HTML>

Kirk Allen Evans
http://www.xmlandasp.net
"XML and ASP.NET", New Riders Publishing
http://www.amazon.com/exec/obidos/ASIN/073571200X

Reply to this message...
 
 
System.EventArgs
System.EventHandler
System.Object
System.Text.Encoding
System.Web.UI.Page
System.Xml.XmlDocument
System.Xml.XmlNode
System.Xml.XmlTextWriter




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification