http://www.codeproject.com/Articles/483055/XML-Serialization-and-Deserialization-Part-1
http://www.codeproject.com/Articles/487571/XML-Serialization-and-Deserialization-Part-2 I need all in C# form application
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 22, 2013, 4:50 AM
Regards,
Iftikar
om prakashPosted Jul 22, 2013, 4:41 AM
om prakashPosted Jul 22, 2013, 4:40 AM
Iftikar HussainPosted Jul 22, 2013, 4:36 AM
Regards,
Iftikar
om prakashPosted Jul 22, 2013, 4:15 AM
thnx I got output.. but I want to do deserialize method how can I do......I want to complete my tasks
Iftikar HussainPosted Jul 22, 2013, 3:20 AM
public class AddressDetails
Regards,
Iftikar
om prakashPosted Jul 22, 2013, 3:11 AM
om prakashPosted Jul 22, 2013, 3:11 AM
Iftikar HussainPosted Jul 22, 2013, 3:04 AM
What error message your getting? Your code seems to be correct.
Regards,
Iftikar
om prakashPosted Jul 22, 2013, 2:56 AM
I have got error in this line...............
the code is
class file:
Using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication6
{
class AddressDetails
{
public int HouseNo { get; set; }
public string StreetName { get; set; }
public string City { get; set; }
private string PoAddress { get; set; }
}
}
form:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;
using System.IO;
using System.Xml;
namespace ConsoleApplication6
{
class Program
{
static void Main(string[] args)
{
{
AddressDetails details = new AddressDetails();
details.HouseNo = 4;
details.StreetName = "Rohini";
details.City = "Delhi";
Serialize(details);
}
}
static public void Serialize(AddressDetails details)
{
XmlSerializer serializer = new XmlSerializer(typeof(AddressDetails));
using (TextWriter writer = new StreamWriter(@"D:\Xml.xml"))
{
serializer.Serialize(writer, details);
}
}
}
}