Deserialization ?

J

Jarod

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
 
V

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
 
M

Michael Nemtsev

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
 
J

Jarod

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top