Please help with getting the right structure from dataset usingGetXML()

  • Thread starter Thread starter emailhelen
  • Start date Start date
E

emailhelen

Hi everyone,

I need your help getting my getXML method to function the way I need
it to. I have a stored procedure that returns data into a dataset (I
am using VB.NET). I use getXML with dataset and I get the following
result:

<NewDataSet>
<Table>
<StudentFirstName>John</StudentFirstName>
<StudentMiddleName>J</StudentMiddleName>
<StudentLastName>Smith</StudentLastName>
<StudentAddressType>Permanent</StudentAddressType>
<StudentAddressLine1>123 Some Rd</StudentAddressLine1>
<StudentAddressLine2 />
<StudentAddressLine3 />
<StudentAddressLine4 />
<StudentAddressCity>New Town</StudentAddressCity>
<StudentAddressState>NJ</StudentAddressState>
<StudentAddressPostalCode>12345</StudentAddressPostalCode>
<StudentAddressCounty />
<StudentAddressCountry>United States</StudentAddressCountry>
<StudentHomePhoneNumber>1234567890</StudentHomePhoneNumber>
<StudentCellPhoneNumber>1234567890</StudentCellPhoneNumber>
<Parent1FirstName>Jane</Parent1FirstName>
<Parent1MiddleName />
<Parent1LastName>Smith</Parent1LastName>
<Parent1HomePhoneNumber>1234567890</Parent1HomePhoneNumber>
<Parent1WorkPhoneNumber />
<Parent1EmailType>Personal</Parent1EmailType>
<Parent1EmailAddress>[email protected]</Parent1EmailAddress>
<Parent2FirstName>John Sr</Parent2FirstName>
<Parent2MiddleName />
<Parent2LastName>Smith</Parent2LastName>
<Parent2HomePhoneNumber>1234567890</Parent2HomePhoneNumber>
<Parent2WorkPhoneNumber />
<Parent2EmailType>Personal</Parent2EmailType>
<Parent2EmailAddress>[email protected]</Parent2EmailAddress>
</Table>
</NewDataSet>

Which is all fine and good but what I really need to get is the
following:
<Data>
<StudentData>
<StudentFirstName>John</StudentFirstName>
<StudentMiddleName>J</StudentMiddleName>
<StudentLastName>Smith</StudentLastName>
<StudentAddressType>Permanent</StudentAddressType>
<StudentAddressLine1>123 Some Rd</StudentAddressLine1>
<StudentAddressLine2 />
<StudentAddressLine3 />
<StudentAddressLine4 />
<StudentAddressCity>New Town</StudentAddressCity>
<StudentAddressState>NJ</StudentAddressState>
<StudentAddressPostalCode>12345</StudentAddressPostalCode>
<StudentAddressCounty />
<StudentAddressCountry>United States</StudentAddressCountry>
<StudentHomePhoneNumber>1234567890</StudentHomePhoneNumber>
<StudentCellPhoneNumber>1234567890</StudentCellPhoneNumber>
</StudentData>
<ParentData>
<Parent>
<Parent1FirstName>Jane</Parent1FirstName>
<Parent1MiddleName />
<Parent1LastName>Smith</Parent1LastName>
<Parent1HomePhoneNumber>1234567890</
Parent1HomePhoneNumber>
<Parent1WorkPhoneNumber />
<Parent1EmailType>Personal</Parent1EmailType>
<Parent1EmailAddress>[email protected]</
Parent1EmailAddress>
</Parent>
<Parent>
<Parent2FirstName>John Sr</Parent2FirstName>
<Parent2MiddleName />
<Parent2LastName>Smith</Parent2LastName>
<Parent2HomePhoneNumber>1234567890</
Parent2HomePhoneNumber>
<Parent2WorkPhoneNumber />
<Parent2EmailType>Personal</Parent2EmailType>
<Parent2EmailAddress>[email protected]</
Parent2EmailAddress>
</Parent>
</ParentData>
</Data>

Can someone please help me figure out how to impose this structure
upon the XML I get from the dataset returned by my stored procedure?
Thanks in advance for your anticipated assistance!
 
Hi,

First try to drag it on the surface of a component (or even your form) in
the ide.

Normally then will an dataset be created.

Cor
 
Hi,

First try to drag it on the surface of a component (or even your form) in
the ide.

Normally then will an dataset be created.

Cor










- Show quoted text -

Cor,

I already have a dataset. And I am writing a web service so that
draggy stuff does not really apply, this is not for the front end. I
just need help getting XML into the correct format.
 
ds.ReadXML(ThePath)


Hi,

First try to drag it on the surface of a component (or even your form) in
the ide.

Normally then will an dataset be created.

Cor










- Show quoted text -

Cor,

I already have a dataset. And I am writing a web service so that
draggy stuff does not really apply, this is not for the front end. I
just need help getting XML into the correct format.
 
emailhelen said:
I need your help getting my getXML method to function the way I need
it to. I have a stored procedure that returns data into a dataset (I
am using VB.NET). I use getXML with dataset and I get the following
result:

<NewDataSet>
<Table>
Which is all fine and good but what I really need to get is the
following:
<Data>
<StudentData>

Could you do a Replace on the raw text; i.e. change "NewDataSet>" to "Data>"
and "Table>" to "StudentData>"?

Andrew
 
Andrew said:
Could you do a Replace on the raw text; i.e. change "NewDataSet>" to
"Data>" and "Table>" to "StudentData>"?

Or even set the DataSetName and its tables' TableName values?

Andrew
 
Back
Top