473,592 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ 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 XmlArrayItemAtt ribute.

Using the XPath applicationdefi nition/applicationsect ions, the dataset
fills properly, but I need to serialize the xml back into a array
property of custom types

<System.Xml.Ser ialization.XmlR ootAttribute([Namespace]:="",
IsNullable:=Fal se)> _
Public Class applicationdefi nition
'<remarks/>
<System.Xml.Ser ialization.XmlA rrayItemAttribu te(IsNullable:= False)>
_
Public applicationsect ions() 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(G etType(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(G etType(a),t)
Dim applicationsect ions() as section = x.Deserialize(N ew
StringReader(cl assData.GetXml) )

If anyone can offer any pointers I would appreciate it

Kind regards

Matt Parker
Nov 12 '05 #1
0 1726

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

Similar topics

0
1228
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, half of it is missing. Is there a bug with remoting and serializing datasets or typed datasets? I am able to serialize typed datasets with remote methods, but at this point I am worried that I am playing with fire.
1
2077
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 created a couple of objects and serializing it into XML based upon the schema works perfectly. The XML / Schema looks something like this:
1
5391
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 System.ComponentModel.MarshalByValueComponent.Site of type System.ComponentModel.ISite because it is an interface. I tried a number of workarounds without sucess:
2
3514
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: + More ways to contact me __________________________________________________________________
4
3424
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 text and very large. I am thinking about zipping it but was wondering if maybe there was a better way? System.Runtime.Serialization.IFormatter f = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); System.IO.MemoryStream ms1...
1
2571
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 session. All of the objects are classes which inherit from a typed dataset. Looking at MSDN I have found the following two (what I believe to be) relevent statements (from article Object
0
1057
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 then de-serialize it again. This generally works well, but I just hit a problem de-serializing it. I have a vb class set up with commonly used code and have functions to handle serialization and de-serialization. Suddenly, I'm hitting the...
2
1315
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 password and SQL info. This is bad. I can think of two ways to deal with this: 1. Parse the data out of the schema before i send it out 2. Encrypt the data My question is......is there a better way?
7
2815
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 the user to specify some settings and I need to persist these settings between runs. I made a serializable class which uses the BinaryFormatter to serialize/deserialize the setttings. Serialization works great. However, when I try to...
0
7871
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,...
1
7995
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
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
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
3851
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
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2379
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 we have to send another system
1
1467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.