Click here to Skip to main content
15,905,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: Set 'visible' property to 'false' for all the opened forms Pin
MGoettmann27-Oct-06 5:11
MGoettmann27-Oct-06 5:11 
GeneralRichTextBox Pin
1010210623-Oct-06 12:29
1010210623-Oct-06 12:29 
GeneralRe: RichTextBox Pin
1010210623-Oct-06 12:43
1010210623-Oct-06 12:43 
QuestionC # 3 in net framework 3 package? Pin
SJ_Phoenix23-Oct-06 7:53
SJ_Phoenix23-Oct-06 7:53 
AnswerRe: C # 3 in net framework 3 package? Pin
S. Senthil Kumar23-Oct-06 7:58
S. Senthil Kumar23-Oct-06 7:58 
GeneralRe: C # 3 in net framework 3 package? Pin
SJ_Phoenix23-Oct-06 8:07
SJ_Phoenix23-Oct-06 8:07 
QuestionHELP - Datagrid Pin
Wargamon23-Oct-06 6:56
Wargamon23-Oct-06 6:56 
QuestionSerialization problem Pin
-Yoyosh-23-Oct-06 5:11
-Yoyosh-23-Oct-06 5:11 
I have a very simple and short application, which is copy/pasted below. Serialization goes perfectly nice. The XML file is being created and it looks correct.

The problem starts when trying to deserialize -> I get an error:

Code:
There is an error in XML document (1, 1).

---------------------------------
This is the programme:

[Serializable]<br />
<br />
publicclassData<br />
<br />
{<br />
<br />
[XmlArrayItem(typeof(string))]<br />
<br />
publicArrayList Pol = newArrayList();<br />
<br />
[XmlArrayItem(typeof(string))]<br />
<br />
publicArrayList Eng = newArrayList();<br />
<br />
[XmlArrayItem(typeof(string))]<br />
<br />
publicArrayList Ger = newArrayList();<br />
<br />
}


<br />
<br />
[Serializable]<br />
<br />
publicclassStoreHouse<br />
<br />
{<br />
<br />
[XmlArrayItem(typeof(Data))]<br />
<br />
publicArrayList DataList = newArrayList();<br />
<br />
}


Serialization part:

Data d = newData();<br />
<br />
d.Eng.Add("1");<br />
<br />
d.Eng.Add("2");<br />
<br />
d.Ger.Add("dadas");<br />
<br />
d.Ger.Add("dsadsadAS");<br />
<br />
d.Pol.Add("dasd");<br />
<br />
d.Pol.Add("etrre");<br />
<br />
d.Pol.Add("trtre");<br />
<br />
sh.DataList.Add(d);<br />
<br />
Data d1 = newData();<br />
<br />
d1.Eng.Add("1321");<br />
<br />
d1.Eng.Add("2ds");<br />
<br />
d1.Ger.Add("ddadadas");<br />
<br />
d1.Ger.Add("dsa123123dsadAS");<br />
<br />
d1.Pol.Add("das31231dasd");<br />
<br />
d1.Pol.Add("et3213rre");<br />
<br />
d1.Pol.Add("t131rtre");<br />
<br />
sh.DataList.Add(d1);<br />
<br />
XmlSerializer s = newXmlSerializer(typeof(StoreHouse));<br />
<br />
s.Serialize(new System.IO.StreamWriter(@"c:\a.xml"), sh);


Deserialization part:

XmlSerializer s = newXmlSerializer(typeof(StoreHouse));<br />
<br />
sh = ((StoreHouse)s.Deserialize(new System.IO.StringReader(@"c:\a.xml")));


What do you think may be wrong?

thank you very much in advance
AnswerRe: Serialization problem Pin
led mike23-Oct-06 5:21
led mike23-Oct-06 5:21 
GeneralRe: Serialization problem Pin
-Yoyosh-23-Oct-06 11:58
-Yoyosh-23-Oct-06 11:58 
GeneralRe: Serialization problem Pin
led mike24-Oct-06 5:01
led mike24-Oct-06 5:01 
QuestionHttpWebRequest + CookieContainer Pin
FlyOnIT23-Oct-06 5:09
FlyOnIT23-Oct-06 5:09 
QuestionPort 80 Pin
-Yoyosh-23-Oct-06 5:08
-Yoyosh-23-Oct-06 5:08 
QuestionObtaining Page Rank Pin
gvanto23-Oct-06 5:00
gvanto23-Oct-06 5:00 
QuestionNot have any cell selected in a datagrid Pin
Dan Neely23-Oct-06 4:45
Dan Neely23-Oct-06 4:45 
QuestionOverride inherited delegates??? Pin
lsugirljte23-Oct-06 4:36
lsugirljte23-Oct-06 4:36 
AnswerRe: Override inherited delegates??? Pin
led mike23-Oct-06 5:17
led mike23-Oct-06 5:17 
GeneralRe: Override inherited delegates??? Pin
lsugirljte23-Oct-06 5:34
lsugirljte23-Oct-06 5:34 
AnswerRe: Override inherited delegates??? Pin
S. Senthil Kumar23-Oct-06 8:09
S. Senthil Kumar23-Oct-06 8:09 
AnswerRe: Override inherited delegates??? Pin
lsugirljte23-Oct-06 11:23
lsugirljte23-Oct-06 11:23 
QuestionGenerics: Is there a Synchronized Hashtable equivalent??? Pin
LongRange.Shooter23-Oct-06 4:08
LongRange.Shooter23-Oct-06 4:08 
AnswerRe: Generics: Is there a Synchronized Hashtable equivalent??? Pin
ednrgc23-Oct-06 4:18
ednrgc23-Oct-06 4:18 
GeneralRe: Generics: Is there a Synchronized Hashtable equivalent??? Pin
LongRange.Shooter23-Oct-06 6:55
LongRange.Shooter23-Oct-06 6:55 
Questionhow to Export DataGridView to excel in c# 2005 ? Pin
hdv21223-Oct-06 3:08
hdv21223-Oct-06 3:08 
QuestionRemoting Question Pin
Inkyskin_UK23-Oct-06 2:28
Inkyskin_UK23-Oct-06 2:28 

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.