yymae
asked on
Needed Help on Converting from XmlNode to Dataset
Dear All,
I have a problem here, I'm using C# Webform calling a webservices. The webservices return me a XMLnode, using this XMLnode I want to convert it to dataset so I can bind to the datagrid, by extracting the <CustomerData></CustomerDa ta> block from the xmlnode.
Below is the sample of xmlnode return from webservices.
<?xml version="1.0" encoding="utf-8"?>
<OutputParams>
<CustomerData>
<CustomerID>1</CustomerID>
<CustomerName>TEST1</Custo merName>
<Gender>M </Gender>
<DateOfBirth>19800101</Dat eOfBirth>
</CustomerData>
<CustomerData>
<CustomerID>1</CustomerID>
<CustomerName>TEST2</Custo merName>
<Gender />
<DateOfBirth>19000101</Dat eOfBirth>
</CustomerData>
<CustomerData>
<CustomerID>3</CustomerID>
<CustomerName>TEST3</Custo merName>
<Gender />
<DateOfBirth>19000101</Dat eOfBirth>
</CustomerData>
<ReturnCode>0</ReturnCode>
<ErrorCode>0</ErrorCode>
<ErrorDescription />
</OutputParams>
How can it be done? Please provide some examples on this.
Thanks in advance.
Cheers,
yymae
I have a problem here, I'm using C# Webform calling a webservices. The webservices return me a XMLnode, using this XMLnode I want to convert it to dataset so I can bind to the datagrid, by extracting the <CustomerData></CustomerDa
Below is the sample of xmlnode return from webservices.
<?xml version="1.0" encoding="utf-8"?>
<OutputParams>
<CustomerData>
<CustomerID>1</CustomerID>
<CustomerName>TEST1</Custo
<Gender>M </Gender>
<DateOfBirth>19800101</Dat
</CustomerData>
<CustomerData>
<CustomerID>1</CustomerID>
<CustomerName>TEST2</Custo
<Gender />
<DateOfBirth>19000101</Dat
</CustomerData>
<CustomerData>
<CustomerID>3</CustomerID>
<CustomerName>TEST3</Custo
<Gender />
<DateOfBirth>19000101</Dat
</CustomerData>
<ReturnCode>0</ReturnCode>
<ErrorCode>0</ErrorCode>
<ErrorDescription />
</OutputParams>
How can it be done? Please provide some examples on this.
Thanks in advance.
Cheers,
yymae
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Look at this example...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconanexampleofxmlserializationwithxmlserializer.asp
http://www.fawcette.com/xmlmag/2003_05/online/xml_wahlin_05_19_03/
R.K