/// <summary>
/// Methord used to create Xml By Passing the Object
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static XmlDocument ObjectTOXml(object obj, int val)
{
XmlSerializer serializer = new XmlSerializer(obj.GetType());
MemoryStream msXml = new MemoryStream();
XmlDocument xDoc = new XmlDocument();
serializer.Serialize(msXml, obj);
msXml.Position = 0;
xDoc.Load(msXml);
msXml.Close();
return xDoc;
}
/// Methord used to create Xml By Passing the Object
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public static XmlDocument ObjectTOXml(object obj, int val)
{
XmlSerializer serializer = new XmlSerializer(obj.GetType());
MemoryStream msXml = new MemoryStream();
XmlDocument xDoc = new XmlDocument();
serializer.Serialize(msXml, obj);
msXml.Position = 0;
xDoc.Load(msXml);
msXml.Close();
return xDoc;
}
No comments:
Post a Comment