I am serializing object through XMLSerializer ,but every time i invoke the method old data is getting replaced with the new data,i want to append the object every time i invoke not rewrite ,Below is the code which i have written please help me
XmlSerializer mySerializer = new XmlSerializer(typeof(Employee));
StreamWriter stream = new StreamWriter(@"C:\Users\divya.kakumanu\Documents\Visual Studio 2010\Projects\XmlFile.xml");
try
{
mySerializer.Serialize(stream, emp);
}
catch (SerializationException ex)
{
throw;
}
finally
{
stream.Close();
}
No comments:
Post a Comment