Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DATASET + XML

Status
Not open for further replies.

GSharp69

Programmer
Jan 27, 2008
9
BE
Hi,

I work with the visual studio 2005 c#

Ihave a problem and i need help quickly

I have to do a read operation in an ms sql server with an sql statement, i put my result in a dataset. so far so good

Now i want to read my dataset line by line and make an well formed xml like this example:

<?xml version="1.0" encoding"utf-8"?>
<blablabla>
<person>
<userid>12</userid>
<name>jeff</name>
</person>
<person>
<userid>16</userid>
<name>john</name>
</person>
</blablabla>

HOW DO I DO THIS?
someone has example source code or something?

greetz

GSharp69


 
Hi jurkmonkey,

so with the example you just posted
i can create an xml file because my dataset is filled up?

that would be nice.

Now i just have to ask if they have a schema (xsd) for me.

If they don't have a schema (xsd) for me i probably first have to do the previous steps (save dataset mappings to xsd schema file)?

Thx in advance

GSharp69
 
If you create strongly typed datasets then you can get the schema.

Make sure you read the XMLSchema first and then populate your data.

The namespace you want to look into is

As an added note - I don't create strongly typed datasets normally so I'm not an expert in this territory.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top