Click here to Skip to main content
15,916,293 members
Home / Discussions / C#
   

C#

 
QuestionRe: Databinding listbox Pin
Jacob Dixon1-Feb-08 7:56
Jacob Dixon1-Feb-08 7:56 
GeneralRe: Databinding listbox Pin
Not Active1-Feb-08 8:45
mentorNot Active1-Feb-08 8:45 
GeneralStreaming With Flash media Encoder Pin
kibromg1-Feb-08 5:38
kibromg1-Feb-08 5:38 
GeneralRe: Streaming With Flash media Encoder Pin
Pete O'Hanlon1-Feb-08 9:42
mvePete O'Hanlon1-Feb-08 9:42 
QuestionBinding XML to TreeView - can't get it working? Pin
espeholt_jr1-Feb-08 4:44
espeholt_jr1-Feb-08 4:44 
General.net 2.0 multi selection drop down Pin
arkiboys1-Feb-08 4:03
arkiboys1-Feb-08 4:03 
GeneralRe: .net 2.0 multi selection drop down Pin
Bijesh1-Feb-08 4:44
Bijesh1-Feb-08 4:44 
GeneralLinkedList XML serialization problem Pin
Kosomot1-Feb-08 3:55
Kosomot1-Feb-08 3:55 
Hi,

I'm trying to serialize an object which contains an array of Objects, which holds in one of it's elements a generic LinkedList. And when I try to serialize the object, i get a InvalidOperationException, saying that "There was an error generating the XML document.", and no further details. Does anybody know what can cause this, and how to resolve it?

Here's the example code (doesn't work):
[XmlRoot()]
public class TestObj
{
    private Object[] array = new Object[2];

    public TestObj()
    {
    }

    [XmlArray()]
    public Object[] Items
    {
        get { return array; }
        set { array = value; }
    }
}

class Program
{
    static void Main(string[] args)
    {
        TestObj t = new TestObj();

        LinkedList<String> list = new LinkedList<string>();
        list.AddLast("abcdef");

        t.Items[0] = list;
        t.Items[1] = 123;

        XmlTextWriter wr = new XmlTextWriter("test.xml",Encoding.UTF8);
        XmlSerializer s = new XmlSerializer(typeof(TestObj));

        s.Serialize(wr, t); //throws the exception

        wr.Close();
    }
}

GeneralRe: LinkedList XML serialization problem Pin
Skippums1-Feb-08 5:17
Skippums1-Feb-08 5:17 
GeneralRe: LinkedList XML serialization problem Pin
Kosomot1-Feb-08 7:29
Kosomot1-Feb-08 7:29 
GeneralRe: LinkedList XML serialization problem Pin
Skippums1-Feb-08 8:33
Skippums1-Feb-08 8:33 
GeneralApplication on LAN Pin
mehrdadc481-Feb-08 1:14
mehrdadc481-Feb-08 1:14 
GeneralRe: Application on LAN Pin
Not Active1-Feb-08 2:59
mentorNot Active1-Feb-08 2:59 
GeneralSave the selected items on txt file Pin
Strategic_Thinker1-Feb-08 1:11
Strategic_Thinker1-Feb-08 1:11 
GeneralRe: Save the selected items on txt file Pin
Not Active1-Feb-08 2:57
mentorNot Active1-Feb-08 2:57 
GeneralRe: Save the selected items on txt file Pin
Strategic_Thinker1-Feb-08 3:44
Strategic_Thinker1-Feb-08 3:44 
GeneralRe: Save the selected items on txt file Pin
Not Active1-Feb-08 4:07
mentorNot Active1-Feb-08 4:07 
GeneralRe: Save the selected items on txt file Pin
Strategic_Thinker1-Feb-08 4:49
Strategic_Thinker1-Feb-08 4:49 
GeneralRe: Save the selected items on txt file Pin
Not Active1-Feb-08 4:58
mentorNot Active1-Feb-08 4:58 
GeneralRe: Save the selected items on txt file Pin
J4amieC1-Feb-08 5:29
J4amieC1-Feb-08 5:29 
GeneralRe: Save the selected items on txt file Pin
Strategic_Thinker1-Feb-08 5:40
Strategic_Thinker1-Feb-08 5:40 
GeneralRe: Save the selected items on txt file Pin
Not Active1-Feb-08 5:45
mentorNot Active1-Feb-08 5:45 
GeneralRe: Save the selected items on txt file Pin
DaveyM691-Feb-08 7:26
professionalDaveyM691-Feb-08 7:26 
GeneralRe: Save the selected items on txt file Pin
Not Active1-Feb-08 8:43
mentorNot Active1-Feb-08 8:43 
GeneralRe: Save the selected items on txt file Pin
DaveyM691-Feb-08 9:39
professionalDaveyM691-Feb-08 9:39 

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.