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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

typed dataset schema relating to xml file

Status
Not open for further replies.

robUK2

Programmer
Mar 10, 2008
57
TH
Hello,

VS 2008

I have typed dataset and have added a single data table named dsMissedCalls.xsd and dtMissedCalls.

I would like to save some missed calls for my application. The table is very small not more than 10 rows.

Example. dtMissedCalls(ID, Caller, DateAndTime)

I have created a XML file, and I would like the xml file to have the schema of the typed dataset (dsMissedCalls.xsd).

Before when I have been creating xml file. I would add a new xml file. Then click the "Create Schema" button. That would creaet the schema for the xml file. However, as I have created a typed dataset that already has a schema. The question is. How do I get my xml file to relate to that schema?

So basically I have created a typed dataSet and would like to save added rows to the xml file.

The code below works, but I want to xml to use the dataset schema.

Many thanks for help with this confusing question,

Code:
 DataRow row;
                row = ds.Tables[0].NewRow();
                row["Caller"] = callersName;
                row["DateTime"] = DateTime.Now.ToShortDateString();

                ds.Tables[0].Rows.Add(row);
                ds.WriteXml(missedCallsXML, XmlWriteMode.DiffGram);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top