473,411 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Deserialization ?

Hey
Can I in simple way deserialize data from DataSet ( not typed ) to my object
? Let's say I normally will do this in that way :
myObject.Name = row["Name"].ToString();... and so on. Is there a way to put
some schema object and to automate this task ? Maybe there is any better way
? WebService returns this DataSets and than I need to "parse" it.
Jarod

Mar 25 '06 #1
4 1173
vj
I think you are trying to copy Data from the DataSet object to your object,
one way you could do is Implement a Copy method on your object, and do this
transfer, so all you have to do is call the copy method when needed... or
maybe I am missing something here ?

VJ

"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:e%***************@TK2MSFTNGP09.phx.gbl...
Hey
Can I in simple way deserialize data from DataSet ( not typed ) to my
object ? Let's say I normally will do this in that way :
myObject.Name = row["Name"].ToString();... and so on. Is there a way to
put some schema object and to automate this task ? Maybe there is any
better way ? WebService returns this DataSets and than I need to "parse"
it.
Jarod

Mar 25 '06 #2
Hello Jarod,

Your can call .WriteXml() .WriteXmlSchema() methods of DataSet (and DataTable
for .NET 2.0) to perform your task

J> Hey
J> Can I in simple way deserialize data from DataSet ( not typed ) to my
J> object
J> ? Let's say I normally will do this in that way :
J> myObject.Name = row["Name"].ToString();... and so on. Is there a way
J> to put
J> some schema object and to automate this task ? Maybe there is any
J> better way
J> ? WebService returns this DataSets and than I need to "parse" it.
J> Jarod
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 25 '06 #3
>I think you are trying to copy Data from the DataSet object to your object,
one way you could do is Implement a Copy method on your object, and do this
transfer, so all you have to do is call the copy method when needed... or
maybe I am missing something here ?


You mean Copy method like some interface ? Or you just called it copy for
example ?
Jarod

Mar 25 '06 #4
Recently in an event I have seen use of custom attributes in a business
object and using reflection to load data from the dataset. Something like:

[DataColumn("MyField1")]
public string MyProperty
{
...
}

I haven't experimented with attributes technology, but this is something you
can think of to automate the task.
Mar 27 '06 #5

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

Similar topics

2
by: Serg | last post by:
Hi. I have a problem with deserialization decimal value. I have a simple class: public class A { public decimal d; } The serialization a value 0.00000001 is OK. The file is
3
by: TEK | last post by:
There seems to be a bug when deserialization some classes in the .NET framework. If you try to deserialize a class that has a base class that holds a struct with a member that is implementing...
2
by: Snowman | last post by:
Suppose I have a RootObject which holds a collection of other objects. The other objects have a property (Parent) which refers back to the "parent" collection (b.t.w. my collection is based on...
3
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I am having problems deserializing an object which seems to be serializing just fine. I save the byte array of the serialized object in the database...
3
by: AnkitAsDeveloper [Ankit] | last post by:
Hi i am serializing a 'ref struct' object as follows : private: void Seri( String ^path, Object^ obj ) { FileStream^ fileStrm ; try { //Serialize entire object into Binary stream
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
1
by: parrot toes | last post by:
I tried to post this question before, but there was an error when posting. I case it did get posted and in order to avoid duplication, I'll just repost a summary. I have written a dotnet client...
8
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a...
5
by: Greg Allen | last post by:
I am consuming a web service and using the generated Reference.cs to access the service and the objects associated with it. I have run into a problem where some inherited classes are not being...
7
by: Andrew | last post by:
Hi, I am using DataContractJsonSerializer to deserialize JSON string in C# objects but I am having a problem. Suppose I have a class: class Item { public ItemId Id { get; set; }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
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,...
0
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...

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.