473,382 Members | 1,165 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,382 software developers and data experts.

Serializing between two projects

Joe
Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
Nov 19 '05 #1
8 1378
So long as both classes have the same name and the same public
interface, sure. It should deserialize just fine.

What happened when you tried?

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #2
Joe
Jason,

Thanks for writing.

Class1 and Class2 are not the same class. Class2 uses Class1's properties.
For example, Class2 could have a method call where is needs some information
stored in Class1, i.e.

Sub Method2(TextValue as String, SomeClass1Value as Class1.Property1)

'Do something using the Class1's Property1...

End Sub

I need to pass the information contained in Class1 in Project1 to a method
in Class2 in Project2. I can't allow Project2 to reference Project1.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Jason Kester" wrote:
So long as both classes have the same name and the same public
interface, sure. It should deserialize just fine.

What happened when you tried?

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #3
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how
I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in
different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #4
Joe
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how
I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in
different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #5
Take a look at the sample I posted in reply to the other thread you started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
> Hello All:
>
> Say I have a solution with two projects (Project1 and Project2) and
> each
> project contains a class (Project1 contains Class1 and Project2
> contains
> Class2).
>
> The projects don't reference each other. Here's my question: can I
> serialize Class1 and use the serialized XML in Class2? How would
> Class2
> de-serialize the XML to retrieve the Class1's properties? I don't see
> how
> I
> can do this since Project2 doesn't even know about Class1.
>
> The example in MSDN (the Purchase Order Example) shows how to do this
> but
> with classes in the same project. I want to do it with classes in
> different
> projects.
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #6
Joe
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport? Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Take a look at the sample I posted in reply to the other thread you started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
> Hello All:
>
> Say I have a solution with two projects (Project1 and Project2) and
> each
> project contains a class (Project1 contains Class1 and Project2
> contains
> Class2).
>
> The projects don't reference each other. Here's my question: can I
> serialize Class1 and use the serialized XML in Class2? How would
> Class2
> de-serialize the XML to retrieve the Class1's properties? I don't see
> how
> I
> can do this since Project2 doesn't even know about Class1.
>
> The example in MSDN (the Purchase Order Example) shows how to do this
> but
> with classes in the same project. I want to do it with classes in
> different
> projects.
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #7
Hi Joe,

I can see where this is heading. Read the following articles and references:

http://msdn.microsoft.com/library/de...ialization.asp
http://msdn.microsoft.com/library/de...classtopic.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:8D**********************************@microsof t.com...
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does
not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport?
Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when
the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Take a look at the sample I posted in reply to the other thread you
started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
> How. I've never done this.
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
> "Bruce Barker" wrote:
>
>> write your own serializer.
>>
>> -- bruce (sqlwork.com)
>>
>>
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:DC**********************************@microsof t.com...
>> > Hello All:
>> >
>> > Say I have a solution with two projects (Project1 and Project2) and
>> > each
>> > project contains a class (Project1 contains Class1 and Project2
>> > contains
>> > Class2).
>> >
>> > The projects don't reference each other. Here's my question: can I
>> > serialize Class1 and use the serialized XML in Class2? How would
>> > Class2
>> > de-serialize the XML to retrieve the Class1's properties? I don't
>> > see
>> > how
>> > I
>> > can do this since Project2 doesn't even know about Class1.
>> >
>> > The example in MSDN (the Purchase Order Example) shows how to do
>> > this
>> > but
>> > with classes in the same project. I want to do it with classes in
>> > different
>> > projects.
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #8
Joe
Hi Kevin,

Thanks. I've already read these. The examples that they give are for
classes that all exist in the same project. I am asking about serializing a
class in one project and de-serializing it in another project.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Hi Joe,

I can see where this is heading. Read the following articles and references:

http://msdn.microsoft.com/library/de...ialization.asp
http://msdn.microsoft.com/library/de...classtopic.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:8D**********************************@microsof t.com...
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does
not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport?
Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when
the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Take a look at the sample I posted in reply to the other thread you
started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
> How. I've never done this.
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
> "Bruce Barker" wrote:
>
>> write your own serializer.
>>
>> -- bruce (sqlwork.com)
>>
>>
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:DC**********************************@microsof t.com...
>> > Hello All:
>> >
>> > Say I have a solution with two projects (Project1 and Project2) and
>> > each
>> > project contains a class (Project1 contains Class1 and Project2
>> > contains
>> > Class2).
>> >
>> > The projects don't reference each other. Here's my question: can I
>> > serialize Class1 and use the serialized XML in Class2? How would
>> > Class2
>> > de-serialize the XML to retrieve the Class1's properties? I don't
>> > see
>> > how
>> > I
>> > can do this since Project2 doesn't even know about Class1.
>> >
>> > The example in MSDN (the Purchase Order Example) shows how to do
>> > this
>> > but
>> > with classes in the same project. I want to do it with classes in
>> > different
>> > projects.
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #9

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

Similar topics

1
by: mattoc | last post by:
Happy new year to all. I have a strange error that I've been trying for a while now to fathom.. Basically I have a hierarchy of state classes that I need to serialize to XML. Some of them can...
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...
10
by: copx | last post by:
I want to save a struct to disk.... as plain text. At the moment I do it with a function that just writes the data using fprintf. I mean like this: fprintf(fp, "%d %d", my_struct.a, my_struct.b)...
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: Jason Shohet | last post by:
We are thinking of serializing an object & passing it toseveral functions on web service. This will happen about 35 times as the page loads. The class has about 20 attributes. We're not sure...
2
by: Simon | last post by:
I'm developing a new application and want to use serialization as a way to save my data. But as I add new variables to my classes, how will serializing cope with that? For example, suppose I have...
4
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...
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.