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
giuliano
NA
1
0
Serialization XML with XmlElement(Order) on abstract method
Jul 2 2009 5:55 AM
Hi all,
my name is Giulian and I'm writing from Italy.
I have a big problem with XML Serialization on the override method inherited from abstart class.
I want to create an XML file with a detail order of Tags and so I have use the property "Order" of XmlElement for all public methods.
The problem concern that the serialization fail with a Reflection error.
From window error message I have this error (transalte from italian language):
"Incorret sequence: the property Order is necessary for all method.
Set the Order with XmlElement, XmlAnyElement or XmlaArray for method
methodA.
This is the simple example of my code:
public abstract class A
{
public abstart string methodA(get;set;);
}
[Serializable]
public class B : A
{
private string data1;
private string data2;
private string data3;
ecc...
[XmlElement(Order=0)]
public string Data1
{
get
{...}
set
{...}
}
[XmlElement(Order=1)]
public string Data2
{
get
{...}
set
{...}
}
[XmlElement(Order=2)]
override public string methodA
{
get
{
return this.data3;
}
set
{
this.data3=value;
}
}
}
I have try to comment the abstract method from class A and B and serialization running successfull without tag "data3".
I don't understand how to fix this situation....
Xlm order can works with override method?
Any idea?
Thanking in advance and sorry for my english.
Giulian
Reply
Answers (
1
)
how to add records from datagrid to the database
drag and drop of gridview columns