Click here to Skip to main content
15,922,584 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert a string to expresion Pin
zaxos10-Feb-05 7:22
zaxos10-Feb-05 7:22 
GeneralRe: Convert a string to expresion Pin
numbrel10-Feb-05 7:49
numbrel10-Feb-05 7:49 
GeneralRe: Convert a string to expresion Pin
zaxos11-Feb-05 3:40
zaxos11-Feb-05 3:40 
GeneralRe: Convert a string to expresion Pin
numbrel11-Feb-05 8:23
numbrel11-Feb-05 8:23 
GeneralRe: Convert a string to expresion Pin
zaxos13-Feb-05 20:05
zaxos13-Feb-05 20:05 
GeneralRe: Convert a string to expresion Pin
Christian Graus9-Feb-05 10:04
protectorChristian Graus9-Feb-05 10:04 
GeneralRe: Convert a string to expresion Pin
zaxos11-Feb-05 3:45
zaxos11-Feb-05 3:45 
GeneralSerialize help Pin
MrBean9-Feb-05 3:27
MrBean9-Feb-05 3:27 
I'm looking into serializing some of my classess to/from XML and need some help.

Imagine the scenario below (these are not my actual classes, but illustrate the problem)...

<br />
<br />
Public Class MyReport<br />
  <br />
  Public m_Title as String<br />
  Public m_BackColor as Color<br />
  Public m_Objects as new ArrayList ' Contains MyReportObject objects<br />
<br />
End Class<br />
<br />
Public Class MyReportObject<br />
  <br />
  Public m_Text as String<br />
  Public m_X as Integer<br />
  Public m_Y as Integer<br />
<br />
End Class<br />


How do I enable my two classes for serializing ?

I have tried adding different XML attributes to the class members and the Serializable attribute to the classes :

<br />
<br />
<Serializable()> Public Class MyReport<br />
  <br />
  <Xml.Serialization.XmlAttribute()> Public m_Title as String<br />
  <Xml.Serialization.XmlAttribute()> Public m_BackColor as Color<br />
  <Xml.Serialization.XmlElement()> Public m_Objects as new ArrayList ' Contains several MyReportObject objects<br />
<br />
End Class<br />
<br />
<Serializable()> Public Class MyReportObject<br />
  <br />
  <Xml.Serialization.XmlElement()> Public m_Text as String<br />
  <Xml.Serialization.XmlElement()> Public m_X as Integer<br />
  <Xml.Serialization.XmlElement()> Public m_Y as Integer<br />
<br />
End Class<br />



But I still get an error when I try to serialize the MyReport class ?

What am I doing wrong ?
GeneralRe: Serialize help Pin
Dave Kreskowiak9-Feb-05 16:51
mveDave Kreskowiak9-Feb-05 16:51 
GeneralRe: Serialize help Pin
Anonymous9-Feb-05 21:38
Anonymous9-Feb-05 21:38 
GeneralRe: Serialize help Pin
MrBean9-Feb-05 21:41
MrBean9-Feb-05 21:41 
GeneralRe: Serialize help Pin
Dave Kreskowiak10-Feb-05 5:45
mveDave Kreskowiak10-Feb-05 5:45 
GeneralRe: Serialize help Pin
MrBean10-Feb-05 20:54
MrBean10-Feb-05 20:54 
GeneralRe: Serialize help Pin
Dave Kreskowiak12-Feb-05 3:03
mveDave Kreskowiak12-Feb-05 3:03 
GeneralHelp Recording Audio Pin
GeneArnold9-Feb-05 3:12
GeneArnold9-Feb-05 3:12 
GeneralRe: App.Path (vb.net) Pin
Just Greeky Creek9-Feb-05 0:16
Just Greeky Creek9-Feb-05 0:16 
GeneralRe: App.Path (vb.net) Pin
Ritesh12349-Feb-05 0:23
Ritesh12349-Feb-05 0:23 
GeneralCustom Shaped Window (form) Pin
Member 86210338-Feb-05 22:49
Member 86210338-Feb-05 22:49 
GeneralRe: Custom Shaped Window (form) Pin
Just Greeky Creek9-Feb-05 0:18
Just Greeky Creek9-Feb-05 0:18 
GeneralRe: Custom Shaped Window (form) Pin
Kumar saurabh9-Feb-05 20:16
Kumar saurabh9-Feb-05 20:16 
GeneralRe: Custom Shaped Window (form) Pin
Just Greeky Creek9-Feb-05 20:44
Just Greeky Creek9-Feb-05 20:44 
QuestionCan someone help with this one Pin
Delo8-Feb-05 19:58
Delo8-Feb-05 19:58 
AnswerRe: Can someone help with this one Pin
Dave Kreskowiak9-Feb-05 2:36
mveDave Kreskowiak9-Feb-05 2:36 
QuestionHow To Search in Database in Access Using Adodc Pin
Max's8-Feb-05 19:56
sussMax's8-Feb-05 19:56 
Generalget_URL Pin
students552 university8-Feb-05 19:44
students552 university8-Feb-05 19:44 

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.