473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

xml serilazation

am trying to inherits membership class and implementing IXmlSerializable but
it doesn't work.
public class SSOMembershipUser : System.Web.Security.MembershipUser
,IXmlSerializable

'SSO.Security.SSOMembershipUser' does not implement interface member
'System.Xml.Serialization.IXmlSerializable.GetSche ma()'
Sep 28 '07 #1
2 1158
you class says it will implement IXmlSerializable, so have to implement
the methods.

public XmlSchema GetSchema()
{
return null;
}

public void ReadXml(XmlReader reader)
{
// write code to read xml and fill in your object
}

public void WriteXml(XmlWriter writer)
{
// write code to save your object as xml
}
if you object follows all the rules (all public properties are
serializable) and only public get/set properties need saving, then
instead of implementing IXmlSerializable, you can use the [Serializable]
attribute on your class:

[Serializable]
public class SSOMembershipUser
{
}

this is just a flag the the default xmlserialier can serialize the
object. it will throw a runtime error if it finds a property it can not
serialize.
-- bruce (sqlwork.com)
bobby wrote:
am trying to inherits membership class and implementing IXmlSerializable but
it doesn't work.
public class SSOMembershipUser : System.Web.Security.MembershipUser
,IXmlSerializable

'SSO.Security.SSOMembershipUser' does not implement interface member
'System.Xml.Serialization.IXmlSerializable.GetSche ma()'

Sep 28 '07 #2
Thanks for responding me back.
Actually They are serilizing some properties if I use [Serializable()]
but I have some fields and some properties which are read only like
following I want to have serilaize in XML also. I am using
[XmlRoot("SSOMembershipUser")] and [XmlElement("UserID")] but nothing is
working.

private SSOUser _User = null; //
private SSOUser _LoggedInUser and some properties which are read only like
public int UserID
{
get { return RealUser.UserID; }
}

"bruce barker" wrote:
you class says it will implement IXmlSerializable, so have to implement
the methods.

public XmlSchema GetSchema()
{
return null;
}

public void ReadXml(XmlReader reader)
{
// write code to read xml and fill in your object
}

public void WriteXml(XmlWriter writer)
{
// write code to save your object as xml
}
if you object follows all the rules (all public properties are
serializable) and only public get/set properties need saving, then
instead of implementing IXmlSerializable, you can use the [Serializable]
attribute on your class:

[Serializable]
public class SSOMembershipUser
{
}

this is just a flag the the default xmlserialier can serialize the
object. it will throw a runtime error if it finds a property it can not
serialize.
-- bruce (sqlwork.com)
bobby wrote:
am trying to inherits membership class and implementing IXmlSerializable but
it doesn't work.
public class SSOMembershipUser : System.Web.Security.MembershipUser
,IXmlSerializable

'SSO.Security.SSOMembershipUser' does not implement interface member
'System.Xml.Serialization.IXmlSerializable.GetSche ma()'
Sep 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Aamir | last post by:
Hi, Quick Question: How to create a simple XML with US States list and read it into a combo box. Detail: I am very new to Dot Net technology as well as xml. I am building a desktop app in...
0
by: farseer | last post by:
Hi, I am asking this here in addition to the vstools.office group because i think the issue could possibly be schema or serilazation related... i have a word document which has a custom schema...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.