Click here to Skip to main content
15,914,820 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using IXmlSerializable interface for conversion of Dataset table objects in to XML format.
Please find the class example below.

C#
public class SecondaryRNCTable: IXmlSerializable
{
   public void ReadXml(System.Xml.XmlReader reader)
   {
      IP = reader.GetAttribute("IP");
      int count = int.Parse(reader.GetAttribute("count"));
      reader.ReadStartElement();
      for (int i = 0; i < count; ++i)
      {
         reader.ReadStartElement();
         SecondaryRNC rnc = new SecondaryRNC();
         rnc.ReadXml(reader);
         Add(rnc);
      }
   }

   public void WriteXml(System.Xml.XmlWriter writer)
   {
      writer.WriteAttributeString("IP", parentDOMIP);
      writer.WriteAttributeString("count", Count.ToString());
      writer.WriteStartElement("SecondaryRNCs");
      foreach (SecondaryRNC rnc in this)
      {
         writer.WriteStartElement("SecondaryRNC");
         rnc.WriteXml(writer);
         writer.WriteEndElement();
      }
      writer.WriteEndElement();
   }
}


We add multiple datatables in a dataset say ds and
ds.writeXML(GZipOutputStream, XmlWriteMode.WriteSchema) is invoked to write in outputstream.
So for some tables, it also write assembly information shown below.
msdata:InstanceType="NeighborList.SecondaryRNCTable, projectName, Version=14.0.0.12, Culture=neutral, publicKeyToken=c2e771ef06d8dbb7"

How can I stop this insertion of string while writing in to outputstream?

Please provide input ASAP.

Thanks,
Khyati Vaghela.
Posted
Updated 23-Aug-11 4:09am
v2

1 solution

While using the standard serialisation process, you can't (as far as I know). It writes that string to identify the type that is being serialised, so it knows what to call to deserialise.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900