Hi,
I read a lot of things about Serialization but i'm not sure i understand
what it is really doing.
Anyway, i use in my application the 'Profiles' which must contain things
like name of customers, address... and a kind of shoppinglist.
Therefore i created a class with "<Serializable()" and i created the
profiles in web.config and added "serializeAs="Binary", just like i read in
some doc. Everything works perfectly.
Now i removed "<Serializable()" from the class file and
"serializeAs="Binary" from web.config and it still works.
Could somebody explain me the difference between the two situations: with
"<Serializable()" and without "<Serializable()" ? What does that do and is
it recommended?
Thanks in advance
Bjorn
in App_Code:
<Serializable()_
Public Class myClass
Private _name As string
.....
end class
in web.config:
<profile>
<properties>
...........
<add shoppinglist="eComm" serializeAs="Binary" .../>
</properties>
</profile> 3 1151
Bjorn wrote:
I read a lot of things about Serialization but i'm not sure i understand
what it is really doing.
A Serializable object has code either in it or provided for it by the
Framework that allows it to be "written" out to and "read" back in from
an alternative, "portable" format (commonly Xml).
Typically, I use this to throw objects back and forth across the "Great
..Net Remoting Divide"; the client serializes an object to be passed,
hurls the serialized form across a socket connection to the server,
which dutifully "unpacks" it at the other end into [the same] object,
ready for use there.
Anyway, i use in my application the 'Profiles' which must contain things
like name of customers, address... and a kind of shoppinglist.
Therefore i created a class with "<Serializable()" and i created the
profiles in web.config and added "serializeAs="Binary", just like i read in
some doc. Everything works perfectly.
Does "everything" include any calls to [formatter].Serialize()?
Or putting an object into, say, the ASPNET Session object?
If you don't use the Serialization methods on the object then it doesn't
matter whether the object is Serializable or not.
HTH,
Phill W.
Hi thanks for helping..
The global.asax is empty (so no session object).
About "calls to [formatter].Serialize()", i have no such a thing ...
I suppose the object you mean to be serialised is the shoppinglist?
Can you give an example of code with c"alls to [formatter].Serialize()" and
where it should be placed? Or an example of in the session object?
And, i still don't understand the advantage of this (transforming data in
xml format) in the context of my application. Will it run faster?
Thanks
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kschreef in bericht
news:er**********@south.jnrs.ja.net...
Bjorn wrote:
>I read a lot of things about Serialization but i'm not sure i understand what it is really doing.
A Serializable object has code either in it or provided for it by the
Framework that allows it to be "written" out to and "read" back in from an
alternative, "portable" format (commonly Xml).
Typically, I use this to throw objects back and forth across the "Great
.Net Remoting Divide"; the client serializes an object to be passed, hurls
the serialized form across a socket connection to the server, which
dutifully "unpacks" it at the other end into [the same] object, ready for
use there.
>Anyway, i use in my application the 'Profiles' which must contain things like name of customers, address... and a kind of shoppinglist. Therefore i created a class with "<Serializable()" and i created the profiles in web.config and added "serializeAs="Binary", just like i read in some doc. Everything works perfectly.
Does "everything" include any calls to [formatter].Serialize()?
Or putting an object into, say, the ASPNET Session object?
If you don't use the Serialization methods on the object then it doesn't
matter whether the object is Serializable or not.
HTH,
Phill W.
Does "serializeAs="Binary" in web.config not replacethe Serialization
method ?
In the whole project, i couldn't find any [formatter].Serialize().
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kschreef in bericht
news:er**********@south.jnrs.ja.net...
Bjorn wrote:
>I read a lot of things about Serialization but i'm not sure i understand what it is really doing.
A Serializable object has code either in it or provided for it by the
Framework that allows it to be "written" out to and "read" back in from an
alternative, "portable" format (commonly Xml).
Typically, I use this to throw objects back and forth across the "Great
.Net Remoting Divide"; the client serializes an object to be passed, hurls
the serialized form across a socket connection to the server, which
dutifully "unpacks" it at the other end into [the same] object, ready for
use there.
>Anyway, i use in my application the 'Profiles' which must contain things like name of customers, address... and a kind of shoppinglist. Therefore i created a class with "<Serializable()" and i created the profiles in web.config and added "serializeAs="Binary", just like i read in some doc. Everything works perfectly.
Does "everything" include any calls to [formatter].Serialize()?
Or putting an object into, say, the ASPNET Session object?
If you don't use the Serialization methods on the object then it doesn't
matter whether the object is Serializable or not.
HTH,
Phill W.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Hasani |
last post by:
If I have a base class that is derived from many classes, and I want to make
all the classes serializable. Is there a way I can do this from the base
class or must I add to every class, even if...
|
by: Skip |
last post by:
Hi,
I'm new to .NET remoting and there's something I'm having real trouble with.
Basically, I'd like to create a component that can act as a server and as a
client (can send messages and receive...
|
by: Tiraman :-\) |
last post by:
Hi,
i have a StreamWriter that hold a System.Net.Sockets.NetwrokStream
and the StreamWriter Object Hold An ArrayList which
i would like to Serialize And Send it back to the client via the...
|
by: jason |
last post by:
we have developed a .NET class library that defines a family of
reusable business objects. the class library is developed in C#, and
works quite well.
one problem, however, is that as more and...
|
by: Evian Spring |
last post by:
We are planning on using "SqlServer" mode for our ASP.NET session
state.
I know for the classes we store in Session that I need to mark them
with the SerializableAttribute as described in this...
|
by: V |
last post by:
Hi,
I am trying to ascertain if Object Serialization (binary or xml) has
been improved (new classes, or new ways) from version 1.1 of the .net
framework.
I pretty much know how to do that in...
|
by: Roy Chastain |
last post by:
I have a schema that has been in existence over 1 year. I have been making a few minor modifications to it recently and suddenly
the generated C# classes have made a radical change.
I have just...
|
by: raj |
last post by:
I know what interfaces are and what they used for etc. Today i am learning
about serilization.
I know to mark the class "serializable" and implement ISerializable
interface, and then implement...
|
by: groovyghoul |
last post by:
Hi
I have the following XML file:
===========================================================
<?xml version="1.0" encoding="UTF-16"?>
<Policy xmlns="http://tempuri.org/richard.xsd">
<TransType...
|
by: Casper |
last post by:
Hi,
i read several articles about serialization. I know now that it is a process
of converting an object into a stream of data so that it can be is easily
transmittable over the network or can...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
|
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...
| |