473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Serializing dataset xml to class

Hi

I was wondering if anyone would be able to help me with this problem.

I have an annotated schema that I use to query my database and fill a
dataset using the sqlxmladapter. The call to query the database is
made through a webservice.

I have used xsd.exe to create a serializable class based on the
schema, that I can pass back through the webservice, but I have a
problem when the particular XPath returns an XmlArrayItemAttribute.

Using the XPath applicationdefinition/applicationsections, the dataset
fills properly, but I need to serialize the xml back into a array
property of custom types

<System.Xml.Serialization.XmlRootAttribute([Namespace]:="",
IsNullable:=False)> _
Public Class applicationdefinition
'<remarks/>
<System.Xml.Serialization.XmlArrayItemAttribute(Is Nullable:=False)>
_
Public applicationsections() As section
End Class

so I can return the class back over the webservice.

I don't think I can do something like

Dim x as new XmlSerializer(GetType(sections())

and using the overloaded constructor that takes an array of extra
types fails too.

Dim a() as section
Dim t() as Type = new Type() {section}
Dim x as XmlSerializer(GetType(a),t)
Dim applicationsections() as section = x.Deserialize(New
StringReader(classData.GetXml))

If anyone can offer any pointers I would appreciate it

Kind regards

Matt Parker
Nov 12 '05 #1
0 1719

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

Similar topics

0
by: Mike Peretz | last post by:
I don't know why, but for some reason exception do not serialize correctly when they hold a typed dataset. I have added code to serialize the dataset, but still when it gets to the other appDomain,...
1
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I...
1
by: Chris | last post by:
I'm having trouble Serializing a System.Data.DataColumn object. When I try to serialize it, I get the following: System.NotSupportedException: Cannot serialize member...
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
4
by: John J. Hughes II | last post by:
I am serializing a dataset and sending it across a slow socket connection using the following code. I know I can send binary data across a socket but when I serialize the dataset it ends up being...
1
by: Aidan Glendye | last post by:
Hi, I am trying to store various objects within session. Due to the site being hosted in a web farm we are going to have to use either State Server or SQL Server to persist the data in...
0
by: MattB | last post by:
I have a dataset that originated as a string (passed from a C++ dll). I de-serialize it, use the data, and then in some cases I will serialize it again to pass as a session variable in my app and...
2
by: Doug Eller | last post by:
I am serializing datasets and sending them out to a client application via a web service. My problem is that the associated schema includes all of my connection string, database username and...
7
by: fjlaga | last post by:
I have written an Office Add-in for Excel using VB.NET and the .NET 1.1 Framework (I have Visual Studio 2003 .NET ). All works great. I want to add a User Settings/Prefereneces dialog and allow...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
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...

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.