473,657 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still Problems Serializing Arrays

I am still stuck trying to create a Class to use for exporting and importing
array data to/from XML. The format of the XML that I want to import/export
is shown below as is the Class and the code I am using to create a sample
XML file. I am trying to dimension the ArrayOfJudgeEnt ity to have two sets
of the JudgeTableEntit y values. When I run the code I get an error that the
XML is not correct.

I jsut can't get my head around the array serialization.

Any help is much appreciated

Wayne

=============== ==== Desired XML ==============
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfJudgeTa bleEntity xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<JudgeTableEnti ty>
<JudgeId>633719 91-cdf9-4cc5-99c1-a42c599498f8</JudgeId>
<JudgeFirstName >Kristen</JudgeFirstName>
<JudgeLastName> O'Melia</JudgeLastName>
<JudgeType>Equi pment</JudgeType>
</JudgeTableEntit y>
<JudgeTableEnti ty>
<JudgeId>ce2c0c 6e-4094-43da-9d8c-9726d81b017e</JudgeId>
<JudgeFirstName >Smith</JudgeFirstName>
<JudgeLastName> Dan</JudgeLastName>
<JudgeType>Move ment</JudgeType>
</JudgeTableEntit y>
</ArrayOfJudgeTab leEntity>

============= Class Definition =============
Public Class ArrayOfJudgeTab leEntity
'<XmlArray("Jud geTableEntity") , XmlArrayItem("J udgeTableEntity ",
IsNullable:=Tru e)> Public JudgeTableEntit yX() As JudgeTableEntit y
<XmlElement("Ju dgeTableEntity" , IsNullable:=Tru e)> Public
JudgeTableEntit y()
Public Sub New()
End Sub
Public Sub New(ByVal j As Integer)
ReDim Preserve JudgeTableEntit y(j)
End Sub 'New
End Class
Public Class JudgeTableEntit y
<XmlElement("Ju dgeID")> Public JudgeID As String
<XmlElement("Ju dgeFirstName")> Public JudgeFirstName As String
<XmlElement("Ju dgeLastName")> Public JudgeLastName As String
<XmlElement("Ju dgeType")> Public JudgeType As String
Public Sub New()
End Sub 'New
Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As
String, ByVal type As String)
JudgeID = id
JudgeType = type
JudgeFirstName = fn
JudgeLastName = ln
End Sub
End Class

=============== = Code to Build Sample Output =============== ==
Dim Judge1 As New JudgeTableEntit y("ID1", "Shirlee", "Whitcomb", "GE")
Dim Judge2 As New JudgeTableEntit y("ID2", "Joe", "Courtney", "TaP")
Dim array2 As New ArrayOfJudgeTab leEntity(1)
array2.JudgeTab leEntity(0) = Judge1
array2.JudgeTab leEntity(1) = Judge2
Dim ser As New XmlSerializer(G etType(ArrayOfJ udgeTableEntity ))
AddHandler ser.UnknownNode , AddressOf serializer_Unkn ownNode
AddHandler ser.UnknownElem ent, AddressOf serializer_Unkn ownElement
Dim writer As New XmlTextWriter(" c:\Temp\judgest est.xml",
System.Text.Enc oding.UTF8)
' write a human readable file
writer.Formatti ng = Formatting.Inde nted
Try
ser.Serialize(w riter, array2)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical, "Error")
'End
End Try
writer.Close()
Nov 12 '05 #1
4 2726
Wayne,

I took your sample XML, inferred a schema with xsd.exe, which ships as part
of the .NET framework, and generated classes that can deserialize XML that
conforms to the schema ... see code below.

There are other tools to infer schemas and create .NET classes for
serialization as well. Take a look at the XML tools page on gotdotnet for the
links.

Each tool as their strengths and weaknesses, but they may get you started in
the right direction.
You're issue right now seems to be that you are trying to deserialize an
array of ArrayOfJudgeTab leEntities. Does the XML you are trying to
deserialize contain a root element for the ArrayOfJudgeTab leEntities items or
are you reading a continuous stream to ArrayOfJudgeTab leEntities elements,
which would be an XML document fragment, not a well formed document.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
//------------------------------------------------------------------------------
// <autogenerate d>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.573
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

//
// This source code was auto-generated by xsd, Version=1.1.432 2.573.
//
using System.Xml.Seri alization;
/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="", IsNullable=fals e)]
public class ArrayOfJudgeTab leEntity {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "JudgeTableEnti ty",
Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public ArrayOfJudgeTab leEntityJudgeTa bleEntity[] Items;
}

/// <remarks/>
public class ArrayOfJudgeTab leEntityJudgeTa bleEntity {

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string JudgeId;

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string JudgeFirstName;

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string JudgeLastName;

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public string JudgeType;
}

"Wayne Wengert" wrote:
I am still stuck trying to create a Class to use for exporting and importing
array data to/from XML. The format of the XML that I want to import/export
is shown below as is the Class and the code I am using to create a sample
XML file. I am trying to dimension the ArrayOfJudgeEnt ity to have two sets
of the JudgeTableEntit y values. When I run the code I get an error that the
XML is not correct.

I jsut can't get my head around the array serialization.

Any help is much appreciated

Wayne

=============== ==== Desired XML ==============
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfJudgeTa bleEntity xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<JudgeTableEnti ty>
<JudgeId>633719 91-cdf9-4cc5-99c1-a42c599498f8</JudgeId>
<JudgeFirstName >Kristen</JudgeFirstName>
<JudgeLastName> O'Melia</JudgeLastName>
<JudgeType>Equi pment</JudgeType>
</JudgeTableEntit y>
<JudgeTableEnti ty>
<JudgeId>ce2c0c 6e-4094-43da-9d8c-9726d81b017e</JudgeId>
<JudgeFirstName >Smith</JudgeFirstName>
<JudgeLastName> Dan</JudgeLastName>
<JudgeType>Move ment</JudgeType>
</JudgeTableEntit y>
</ArrayOfJudgeTab leEntity>

============= Class Definition =============
Public Class ArrayOfJudgeTab leEntity
'<XmlArray("Jud geTableEntity") , XmlArrayItem("J udgeTableEntity ",
IsNullable:=Tru e)> Public JudgeTableEntit yX() As JudgeTableEntit y
<XmlElement("Ju dgeTableEntity" , IsNullable:=Tru e)> Public
JudgeTableEntit y()
Public Sub New()
End Sub
Public Sub New(ByVal j As Integer)
ReDim Preserve JudgeTableEntit y(j)
End Sub 'New
End Class
Public Class JudgeTableEntit y
<XmlElement("Ju dgeID")> Public JudgeID As String
<XmlElement("Ju dgeFirstName")> Public JudgeFirstName As String
<XmlElement("Ju dgeLastName")> Public JudgeLastName As String
<XmlElement("Ju dgeType")> Public JudgeType As String
Public Sub New()
End Sub 'New
Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As
String, ByVal type As String)
JudgeID = id
JudgeType = type
JudgeFirstName = fn
JudgeLastName = ln
End Sub
End Class

=============== = Code to Build Sample Output =============== ==
Dim Judge1 As New JudgeTableEntit y("ID1", "Shirlee", "Whitcomb", "GE")
Dim Judge2 As New JudgeTableEntit y("ID2", "Joe", "Courtney", "TaP")
Dim array2 As New ArrayOfJudgeTab leEntity(1)
array2.JudgeTab leEntity(0) = Judge1
array2.JudgeTab leEntity(1) = Judge2
Dim ser As New XmlSerializer(G etType(ArrayOfJ udgeTableEntity ))
AddHandler ser.UnknownNode , AddressOf serializer_Unkn ownNode
AddHandler ser.UnknownElem ent, AddressOf serializer_Unkn ownElement
Dim writer As New XmlTextWriter(" c:\Temp\judgest est.xml",
System.Text.Enc oding.UTF8)
' write a human readable file
writer.Formatti ng = Formatting.Inde nted
Try
ser.Serialize(w riter, array2)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical, "Error")
'End
End Try
writer.Close()

Nov 12 '05 #2
Christoph;

Thanks for the response. You are right that I need to learn more about the
available tools. I'll check out that link and review your suggestions.

The ArrayOfJudgeTab leEntities is the root element (occurs only once). There
are many JudgeTableEntit y sets within that root.

Wayne
"Christoph Schittko [MVP]" <Christoph Schittko
[MVP]@discussions.mi crosoft.com> wrote in message
news:03******** *************** ***********@mic rosoft.com...
Wayne,

I took your sample XML, inferred a schema with xsd.exe, which ships as part of the .NET framework, and generated classes that can deserialize XML that
conforms to the schema ... see code below.

There are other tools to infer schemas and create .NET classes for
serialization as well. Take a look at the XML tools page on gotdotnet for the links.

Each tool as their strengths and weaknesses, but they may get you started in the right direction.
You're issue right now seems to be that you are trying to deserialize an
array of ArrayOfJudgeTab leEntities. Does the XML you are trying to
deserialize contain a root element for the ArrayOfJudgeTab leEntities items or are you reading a continuous stream to ArrayOfJudgeTab leEntities elements,
which would be an XML document fragment, not a well formed document.

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
//--------------------------------------------------------------------------
---- // <autogenerate d>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.573
//
// Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated.
// </autogenerated>
//--------------------------------------------------------------------------
----
//
// This source code was auto-generated by xsd, Version=1.1.432 2.573.
//
using System.Xml.Seri alization;
/// <remarks/>
[System.Xml.Seri alization.XmlRo otAttribute(Nam espace="", IsNullable=fals e)] public class ArrayOfJudgeTab leEntity {

/// <remarks/>
[System.Xml.Seri alization.XmlEl ementAttribute( "JudgeTableEnti ty",
Form=System.Xml .Schema.XmlSche maForm.Unqualif ied)]
public ArrayOfJudgeTab leEntityJudgeTa bleEntity[] Items;
}

/// <remarks/>
public class ArrayOfJudgeTab leEntityJudgeTa bleEntity {

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche
maForm.Unqualif ied)] public string JudgeId;

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche
maForm.Unqualif ied)] public string JudgeFirstName;

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche
maForm.Unqualif ied)] public string JudgeLastName;

/// <remarks/>

[System.Xml.Seri alization.XmlEl ementAttribute( Form=System.Xml .Schema.XmlSche
maForm.Unqualif ied)] public string JudgeType;
}

"Wayne Wengert" wrote:
I am still stuck trying to create a Class to use for exporting and importing array data to/from XML. The format of the XML that I want to import/export is shown below as is the Class and the code I am using to create a sample XML file. I am trying to dimension the ArrayOfJudgeEnt ity to have two sets of the JudgeTableEntit y values. When I run the code I get an error that the XML is not correct.

I jsut can't get my head around the array serialization.

Any help is much appreciated

Wayne

=============== ==== Desired XML ==============
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfJudgeTa bleEntity xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<JudgeTableEnti ty>
<JudgeId>633719 91-cdf9-4cc5-99c1-a42c599498f8</JudgeId>
<JudgeFirstName >Kristen</JudgeFirstName>
<JudgeLastName> O'Melia</JudgeLastName>
<JudgeType>Equi pment</JudgeType>
</JudgeTableEntit y>
<JudgeTableEnti ty>
<JudgeId>ce2c0c 6e-4094-43da-9d8c-9726d81b017e</JudgeId>
<JudgeFirstName >Smith</JudgeFirstName>
<JudgeLastName> Dan</JudgeLastName>
<JudgeType>Move ment</JudgeType>
</JudgeTableEntit y>
</ArrayOfJudgeTab leEntity>

============= Class Definition =============
Public Class ArrayOfJudgeTab leEntity
'<XmlArray("Jud geTableEntity") , XmlArrayItem("J udgeTableEntity ",
IsNullable:=Tru e)> Public JudgeTableEntit yX() As JudgeTableEntit y
<XmlElement("Ju dgeTableEntity" , IsNullable:=Tru e)> Public
JudgeTableEntit y()
Public Sub New()
End Sub
Public Sub New(ByVal j As Integer)
ReDim Preserve JudgeTableEntit y(j)
End Sub 'New
End Class
Public Class JudgeTableEntit y
<XmlElement("Ju dgeID")> Public JudgeID As String
<XmlElement("Ju dgeFirstName")> Public JudgeFirstName As String
<XmlElement("Ju dgeLastName")> Public JudgeLastName As String
<XmlElement("Ju dgeType")> Public JudgeType As String
Public Sub New()
End Sub 'New
Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As
String, ByVal type As String)
JudgeID = id
JudgeType = type
JudgeFirstName = fn
JudgeLastName = ln
End Sub
End Class

=============== = Code to Build Sample Output =============== ==
Dim Judge1 As New JudgeTableEntit y("ID1", "Shirlee", "Whitcomb", "GE")
Dim Judge2 As New JudgeTableEntit y("ID2", "Joe", "Courtney", "TaP") Dim array2 As New ArrayOfJudgeTab leEntity(1)
array2.JudgeTab leEntity(0) = Judge1
array2.JudgeTab leEntity(1) = Judge2
Dim ser As New XmlSerializer(G etType(ArrayOfJ udgeTableEntity ))
AddHandler ser.UnknownNode , AddressOf serializer_Unkn ownNode
AddHandler ser.UnknownElem ent, AddressOf serializer_Unkn ownElement Dim writer As New XmlTextWriter(" c:\Temp\judgest est.xml",
System.Text.Enc oding.UTF8)
' write a human readable file
writer.Formatti ng = Formatting.Inde nted
Try
ser.Serialize(w riter, array2)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical, "Error")
'End
End Try
writer.Close()

Nov 12 '05 #3
Wayne,

In general, you should always be able to deserialize XML written with
the XmlSerializer into instances of the same classes you used to
serialize.
Did you get it to work or do you still have problems? On a side note,
I'm not a VB expert, but does your code compile with Option Strict on?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Wayne Wengert [mailto:wa****** *********@wenge rt.com]
Posted At: Friday, January 28, 2005 8:41 AM
Posted To: microsoft.publi c.dotnet.xml
Conversation: Still Problems Serializing Arrays
Subject: Still Problems Serializing Arrays

I am still stuck trying to create a Class to use for exporting and
importing
array data to/from XML. The format of the XML that I want to import/export is shown below as is the Class and the code I am using to create a sample XML file. I am trying to dimension the ArrayOfJudgeEnt ity to have two sets of the JudgeTableEntit y values. When I run the code I get an error that the
XML is not correct.

I jsut can't get my head around the array serialization.

Any help is much appreciated

Wayne

=============== ==== Desired XML ==============
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfJudgeTa bleEntity xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<JudgeTableEnti ty>
<JudgeId>633719 91-cdf9-4cc5-99c1-a42c599498f8</JudgeId>
<JudgeFirstName >Kristen</JudgeFirstName>
<JudgeLastName> O'Melia</JudgeLastName>
<JudgeType>Equi pment</JudgeType>
</JudgeTableEntit y>
<JudgeTableEnti ty>
<JudgeId>ce2c0c 6e-4094-43da-9d8c-9726d81b017e</JudgeId>
<JudgeFirstName >Smith</JudgeFirstName>
<JudgeLastName> Dan</JudgeLastName>
<JudgeType>Move ment</JudgeType>
</JudgeTableEntit y>
</ArrayOfJudgeTab leEntity>

============= Class Definition =============
Public Class ArrayOfJudgeTab leEntity
'<XmlArray("Jud geTableEntity") , XmlArrayItem("J udgeTableEntity ",
IsNullable:=Tru e)> Public JudgeTableEntit yX() As JudgeTableEntit y
<XmlElement("Ju dgeTableEntity" , IsNullable:=Tru e)> Public
JudgeTableEntit y()
Public Sub New()
End Sub
Public Sub New(ByVal j As Integer)
ReDim Preserve JudgeTableEntit y(j)
End Sub 'New
End Class
Public Class JudgeTableEntit y
<XmlElement("Ju dgeID")> Public JudgeID As String
<XmlElement("Ju dgeFirstName")> Public JudgeFirstName As String
<XmlElement("Ju dgeLastName")> Public JudgeLastName As String
<XmlElement("Ju dgeType")> Public JudgeType As String
Public Sub New()
End Sub 'New
Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As
String, ByVal type As String)
JudgeID = id
JudgeType = type
JudgeFirstName = fn
JudgeLastName = ln
End Sub
End Class

=============== = Code to Build Sample Output =============== ==
Dim Judge1 As New JudgeTableEntit y("ID1", "Shirlee", "Whitcomb", "GE")
Dim Judge2 As New JudgeTableEntit y("ID2", "Joe", "Courtney",
"TaP")
Dim array2 As New ArrayOfJudgeTab leEntity(1)
array2.JudgeTab leEntity(0) = Judge1
array2.JudgeTab leEntity(1) = Judge2
Dim ser As New XmlSerializer(G etType(ArrayOfJ udgeTableEntity ))
AddHandler ser.UnknownNode , AddressOf serializer_Unkn ownNode
AddHandler ser.UnknownElem ent, AddressOf serializer_Unkn ownElement Dim writer As New XmlTextWriter(" c:\Temp\judgest est.xml",
System.Text.Enc oding.UTF8)
' write a human readable file
writer.Formatti ng = Formatting.Inde nted
Try
ser.Serialize(w riter, array2)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical, "Error")
'End
End Try
writer.Close()

Nov 12 '05 #4
Christoph;

Not working yet - I have another crisis that is taking most of my time for
the next day or so. Yes, Option Strict is on.

Thanks for the continued help!

Wayne

"Christoph Schittko [MVP]" <IN**********@a ustin.rr.com> wrote in message
news:u0******** *****@TK2MSFTNG P14.phx.gbl...
Wayne,

In general, you should always be able to deserialize XML written with
the XmlSerializer into instances of the same classes you used to
serialize.
Did you get it to work or do you still have problems? On a side note,
I'm not a VB expert, but does your code compile with Option Strict on?

HTH,
Christoph Schittko
MVP XML
http://weblogs.asp.net/cschittko
-----Original Message-----
From: Wayne Wengert [mailto:wa****** *********@wenge rt.com]
Posted At: Friday, January 28, 2005 8:41 AM
Posted To: microsoft.publi c.dotnet.xml
Conversation: Still Problems Serializing Arrays
Subject: Still Problems Serializing Arrays

I am still stuck trying to create a Class to use for exporting and
importing
array data to/from XML. The format of the XML that I want to

import/export
is shown below as is the Class and the code I am using to create a

sample
XML file. I am trying to dimension the ArrayOfJudgeEnt ity to have two

sets
of the JudgeTableEntit y values. When I run the code I get an error

that
the
XML is not correct.

I jsut can't get my head around the array serialization.

Any help is much appreciated

Wayne

=============== ==== Desired XML ==============
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfJudgeTa bleEntity xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
<JudgeTableEnti ty>
<JudgeId>633719 91-cdf9-4cc5-99c1-a42c599498f8</JudgeId>
<JudgeFirstName >Kristen</JudgeFirstName>
<JudgeLastName> O'Melia</JudgeLastName>
<JudgeType>Equi pment</JudgeType>
</JudgeTableEntit y>
<JudgeTableEnti ty>
<JudgeId>ce2c0c 6e-4094-43da-9d8c-9726d81b017e</JudgeId>
<JudgeFirstName >Smith</JudgeFirstName>
<JudgeLastName> Dan</JudgeLastName>
<JudgeType>Move ment</JudgeType>
</JudgeTableEntit y>
</ArrayOfJudgeTab leEntity>

============= Class Definition =============
Public Class ArrayOfJudgeTab leEntity
'<XmlArray("Jud geTableEntity") , XmlArrayItem("J udgeTableEntity ",
IsNullable:=Tru e)> Public JudgeTableEntit yX() As JudgeTableEntit y
<XmlElement("Ju dgeTableEntity" , IsNullable:=Tru e)> Public
JudgeTableEntit y()
Public Sub New()
End Sub
Public Sub New(ByVal j As Integer)
ReDim Preserve JudgeTableEntit y(j)
End Sub 'New
End Class
Public Class JudgeTableEntit y
<XmlElement("Ju dgeID")> Public JudgeID As String
<XmlElement("Ju dgeFirstName")> Public JudgeFirstName As String
<XmlElement("Ju dgeLastName")> Public JudgeLastName As String
<XmlElement("Ju dgeType")> Public JudgeType As String
Public Sub New()
End Sub 'New
Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As
String, ByVal type As String)
JudgeID = id
JudgeType = type
JudgeFirstName = fn
JudgeLastName = ln
End Sub
End Class

=============== = Code to Build Sample Output =============== ==
Dim Judge1 As New JudgeTableEntit y("ID1", "Shirlee", "Whitcomb", "GE")
Dim Judge2 As New JudgeTableEntit y("ID2", "Joe", "Courtney",
"TaP")
Dim array2 As New ArrayOfJudgeTab leEntity(1)
array2.JudgeTab leEntity(0) = Judge1
array2.JudgeTab leEntity(1) = Judge2
Dim ser As New XmlSerializer(G etType(ArrayOfJ udgeTableEntity ))
AddHandler ser.UnknownNode , AddressOf serializer_Unkn ownNode
AddHandler ser.UnknownElem ent, AddressOf

serializer_Unkn ownElement
Dim writer As New XmlTextWriter(" c:\Temp\judgest est.xml",
System.Text.Enc oding.UTF8)
' write a human readable file
writer.Formatti ng = Formatting.Inde nted
Try
ser.Serialize(w riter, array2)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Cri tical, "Error")
'End
End Try
writer.Close()


Nov 12 '05 #5

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

Similar topics

5
1425
by: François Miville-Dechêne | last post by:
You say in the definition of mappings that at present Python has only one type of it, the dictionnary. I suggest another one, the sparse array, where absence of key would mean not absence of element but presence of a default-value element, such as zero for sparse arrays in the mathematical sense. This would enable the use of mapping with the distributive operators as I just suggested them in a previous e-mail. I will be pestering you...
2
2061
by: -Steve- | last post by:
Okay I have a bunch of code below. Hope it comes across readable. The problem I'm having is that in the lines under main(): cout << a << endl; Is going into the code for IntArray(const IntArray&);. Without that function these first 5 tests work fine. Of course I need that come test6(). Also something must be wrong with the deconstructor. If I comment it out my
1
1683
by: dotNetDave | last post by:
I'm trying to create xml seriaizable collection class (below), but the xml keeps coming out wrong. In the resulting xml from the web service (below) the "ArrayOfAlarmProcessor" tag should really be "Processors" and the "AlarmProcessor" tag should be "Processor". <ArrayOfAlarmProcessor xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://mycompany/webservice/NetworkAlarms">...
0
1327
by: Ante Smolcic | last post by:
Hi all, I have an ArrayList that contains items of type A. I declared the XmlArrayItem atribute for that type. Now I have an derived type B (from A) also contained in the ArrayList but I get an error when serializing. Can this be made without redeclaring the ArrayList special attributes? The problem is that the class B is in different namespace!
0
1191
by: Alex Clark | last post by:
Hi all, Apologies for the cross-post but I can't determine if this is a VS .NET problem or a VB.NET language issue. I'm using .NET 1.1 SP1, VS 2003 EA, VB.NET. I'm coding a custom component which is designed to be dropped onto a form and have it's properties manipulated at runtime. I have a custom implementation of the TypeConverter class called UniversalTypeConverter which inherits from ExpandableObjectConverter, and for the most...
1
1181
by: Alex Clark | last post by:
Hi all, Apologies for the cross-post but I can't determine if this is a VS .NET problem or a VB.NET language issue. I'm using .NET 1.1 SP1, VS 2003 EA, VB.NET. I'm coding a custom component which is designed to be dropped onto a form and have it's properties manipulated at runtime. I have a custom implementation of the TypeConverter class called UniversalTypeConverter which inherits from ExpandableObjectConverter, and for the most...
4
1303
by: mookid8000 | last post by:
Good day group! I have created a nice filtering plugin system, where all filters derive from a Filter class, and they pass a PictureData object between them. I have a problem though. I am able to save the filter setup by serializing the filter chain to a file, and there seems to be no problems when de-serializing, as the filter chain will seem to re-generate properly.
2
2876
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hi, I know this will sound like a lot of hand waving, and I'll be glad to supply some sample code if necessary, but I thought something obvious might jump out at someone without doing so. Anyway, I have a structure that has several members including an array of strings. I assign the elements of the string array from the .Text property of several TextBoxes. I then serialize the structure and write it to a file. However, when I...
0
1234
by: dph5010 | last post by:
I'm trying to make an object that will reflect the response from isbndb.com's API so I can serialize the results into my code. Right now I have code that works, however, the structure isn't quite the same as what isbndb.com uses. My problem, is serializing the array of BookData objects and putting attributes into the array wrapper tag <BookList>. Right now, I'm just using a custom object called BookList to add attributes to the element, but...
0
8397
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.