Click here to Skip to main content
16,007,163 members
Home / Discussions / C#
   

C#

 
GeneralRe: Insert Image into MS-SQL Pin
Hovik Melkomian5-Oct-03 2:33
Hovik Melkomian5-Oct-03 2:33 
GeneralImage library Pin
abc8764-Oct-03 1:19
abc8764-Oct-03 1:19 
GeneralRe: Image library Pin
J. Dunlap4-Oct-03 12:45
J. Dunlap4-Oct-03 12:45 
QuestionHow to make an window application run one time? Pin
kokain3-Oct-03 20:50
kokain3-Oct-03 20:50 
AnswerRe: How to make an window application run one time? Pin
SimonS4-Oct-03 10:33
SimonS4-Oct-03 10:33 
GeneralRe: How to make an window application run one time? Pin
kokain4-Oct-03 14:42
kokain4-Oct-03 14:42 
GeneralXML serialization problems Pin
Gambit0073-Oct-03 18:09
Gambit0073-Oct-03 18:09 
GeneralRe: XML serialization problems Pin
James T. Johnson3-Oct-03 19:55
James T. Johnson3-Oct-03 19:55 
[rant]
The XmlSerializer has a bad name because it isn't a true serializer. More of a helper class that can spit basic data out as XML. There are two major downfalls with it.

1) It doesn't support inheritence very well. The type of the object declared is the type that gets serialized. Using your example of an array of Person objects (where Player, Coach, and Referree all inherit from Person) the XML that XmlSerializer (XS) spits out will only have the attributes that the Person object exposes.

2) It is only good for holding public data. Say your Person class has some private variables used to maintain state of some sort, for example a Position variable. This variable isn't exposed as a property because it is only of use to the methods within the Person class not its derivatives. This extra state variable isn't serialized by XS because it only searches for public properties and variables (maybe even protected ones, I can't remember).

On top of that all of the data types used by your class publicly, as well as the types they use, etc must all conform to certain restrictions: have a public, parameterless constructor; all public properties that are to be serialized need to be both read and write; and lastly, not use the IDictionary interface publicly this includes use of IDictionary and any class which implements it (XS specifically checks for it).

Unlike the XmlSerializer, the BinaryFormatter and the SoapFormatter are true serializers able to store all the information within an object.
[/rant]

That said, you should check that your Person class has a public parameterless constructor, and that it is not an abstract class (another restriction).

James

"then when you go to bed...wait, you dont do that do you....ok....when you plug into the 'hive mind' to charge yourself, ill hack into your head"
Nnamdi Onyeyiri over MSN

GeneralRe: XML serialization problems Pin
Gambit0074-Oct-03 4:47
Gambit0074-Oct-03 4:47 
GeneralSoapsuds.exe and Remoting Pin
devvvy3-Oct-03 17:56
devvvy3-Oct-03 17:56 
GeneralRe: Soapsuds.exe and Remoting Pin
James T. Johnson3-Oct-03 20:05
James T. Johnson3-Oct-03 20:05 
GeneralRe: Soapsuds.exe and Remoting Pin
devvvy3-Oct-03 21:29
devvvy3-Oct-03 21:29 
GeneralRe: Soapsuds.exe and Remoting Pin
James T. Johnson4-Oct-03 8:10
James T. Johnson4-Oct-03 8:10 
GeneralRe: Soapsuds.exe and Remoting Pin
devvvy4-Oct-03 17:43
devvvy4-Oct-03 17:43 
GeneralPrinting picturebox Pin
Meysam Mahfouzi3-Oct-03 17:10
Meysam Mahfouzi3-Oct-03 17:10 
QuestionEquivilent to GetWindowPlacement? Pin
Joe Woodbury3-Oct-03 12:27
professionalJoe Woodbury3-Oct-03 12:27 
AnswerRe: Equivilent to GetWindowPlacement? Pin
Tomas Petricek3-Oct-03 14:36
Tomas Petricek3-Oct-03 14:36 
GeneralRe: Equivilent to GetWindowPlacement? Pin
Joe Woodbury3-Oct-03 15:21
professionalJoe Woodbury3-Oct-03 15:21 
GeneralStruct Question Pin
J. Dunlap3-Oct-03 12:04
J. Dunlap3-Oct-03 12:04 
GeneralRe: Struct Question Pin
James T. Johnson3-Oct-03 19:57
James T. Johnson3-Oct-03 19:57 
GeneralRe: Struct Question Pin
J. Dunlap3-Oct-03 21:24
J. Dunlap3-Oct-03 21:24 
GeneralDirect3D Fullscreen problem Pin
Mikkel Skovby3-Oct-03 10:41
Mikkel Skovby3-Oct-03 10:41 
GeneralCan't delete a registry value! Pin
Alvaro Mendez3-Oct-03 10:26
Alvaro Mendez3-Oct-03 10:26 
GeneralRe: Can't delete a registry value! Pin
Daniel Turini3-Oct-03 10:29
Daniel Turini3-Oct-03 10:29 
GeneralRe: Can't delete a registry value! Pin
Alvaro Mendez3-Oct-03 10:40
Alvaro Mendez3-Oct-03 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.