Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2007, 05:54 AM
Friend of Wrox
 
Join Date: Apr 2006
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
Default is serialization required for this?

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 be continued in a persistent storage location and that the serializable tag before the class makes the class serializable.

Now i did some tests in order to understand it better, based on a example i found in the Wrox book "beginning asp.net 2.0".
I first executed the code below (this (summarized) code produces a virtual simple shopping cart which is put in the Profile of the user) with the attribute "<Serializable()>" and with what follows in web.config:

<profile><properties>
<add name="myCart" serializeAs="Binary" type="wrox.eCommerce.elist"/>
</properties></profile>

After that, i executed it again without the attribute "<Serializable()>" and without "serializeAs="Binary" from web.config.

I couldn't notice any difference (nor in table 'Profiles', nor in the table 'Orders' where the orders are put, nor in the shopping cart, nor in speed , nor in CPU ..).

So my question is:
------------------
Is serialization required for this? Is there no other way to put the shopping cart content into table Profiles of the database?

With other words: what's the practical difference in this application between using <serialisation> _ and not using it? In both cases, data comes into the sql server table and in both cases, data are retrieved when needed.I tested it.
Is the difference the way data is put (and retrieved) into (from) the table (with serialization: binary stream, without:?) Or is the attribute <serialisation> _ just ignored when using Profiles, or ...?

I thank you in advance
Bob.

The (part of) code:
-------------------

<Serializable()> _
Public Class listitem
        Private _description As String

Public Sub New()
        End Sub

 Public Property description() As String
            Get
                Return _description
            End Get
            Set(ByVal value As String)
                _description = value
            End Set
        End Property
End Class
'--------------------------
 <Serializable()> _
    Public Class elist
....
Public Sub New()
         _items = New List(Of listitem)
End Sub
.....
Public Sub Insert(ByVal Price As Decimal, ByVal description As String)
....
End Class








Similar Threads
Thread Thread Starter Forum Replies Last Post
serialization taheernawaz ASP.NET 1.x and 2.0 Application Design 0 December 12th, 2007 03:32 AM
Complex Serialization abedijoo C# 2005 5 April 18th, 2007 10:38 AM
Hashtable for Serialization in C# sachin-csharp .NET Framework 2.0 0 July 27th, 2004 02:25 AM
T-SQL Serialization blueFrench Pro VB Databases 0 July 15th, 2004 08:01 PM
XML Serialization rajeshnerenki General .NET 0 June 14th, 2004 08:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.