TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vijay
NA
150
90.6k
Serialization&Deserialization
Jul 25 2013 1:36 AM
I did program for xml serialization but i get error on this pgm.... plz clear my bug...
public class Orders
{
public Book[] Books;
}
public class Book
{
//[XmlElement("Newbooooook", typeof(ExpandedBook))]
public string ISBN;
public string BookName;
}
public class ExpandedBook : Book
{
public bool NewEdition;
}
private void Serialize_Click(object sender, EventArgs e)
{
XmlSerializer seer =new XmlSerializer(typeof(Orders));
TextWriter writer = new StreamWriter(@"d:\xmlarra.xml");
Orders myOrders = new Orders();
ExpandedBook b = new ExpandedBook();
b.BookID= txtid.Text;
b.BookName = txtname.Text;
b.NewEdition = bool.Parse(txtbool.Text);
myOrders.Books = new ExpandedBook[] { b };
// Serializes the object.
seer.Serialize(writer, b);
writer.Close();
}
private void txtbool_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox cb = (ComboBox)sender;
if (!cb.Focused)
{
return;
}
}
Reply
Answers (
3
)
C# process running WMPlayer
Process.ClosemainWindow does not work