sandrajean Posted March 27, 2006 Posted March 27, 2006 I am trying to create an xml file from an untyped dataset but not all of the tags defined in my schema are ending up in my xml file. I need all tags in my xml file even if they are empty. I am using the SqlDataAdapter to fill my DataSet and I am using ds.WriteXml to create my xml file. I am calling ReadXmlSchema on the DataSet before filling with data. Any ideas on how I can get all tags to write to my xml file even when no data is returned from my query?? Quote
*Experts* Nerseus Posted March 27, 2006 *Experts* Posted March 27, 2006 I haven't tried this, but when you load the XML into the DataSet I assume you're using ReadXml()? Have you tried the param XmlReadMode.InferSchema? I wonder if that would build the schema for you, and fill in any missing data? -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
sandrajean Posted March 29, 2006 Author Posted March 29, 2006 Thanks for your suggestion! When I write the xml file I write out the schema and then when I read the xml I am using XmlReadMode.ReadSchema. I got the tags to write out by calling ISNULL for every column in my query that can return null and I am putting a value of ' ' (1 space). The problem I am finding with that is now the xml:space="preserve" attribute is writing out and I don't want that either!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.