473,461 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

is not marked as serializable

i use below code for create arraylist()
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.  Dim ItemsT As New ArrayList()
  4.         If ViewState("items") IsNot Nothing Then
  5.             ItemsT = DirectCast(ViewState("items"), ArrayList)
  6.         Else
  7.             ItemsT = New ArrayList()
  8.         End If
  9.         Dim itemID As Integer = EasyListBoxItemT.SelectedValue
  10.         Dim count As String = TextBoxCount.Text
  11.         Dim Dv As Data.DataView
  12.         Dv = ListData.vag_list_GetItem(itemID).Tables(0).DefaultView
  13.         Dim name As String = Dv.Item(0).Item("name")
  14.         Dim Code As String = Dv.Item(0).Item("Code")
  15.         Dim additem As ItemInf = New ItemInf()
  16.         additem.ID = itemID
  17.         additem.Code = Code
  18.         additem.count = count
  19.         additem.Name = name
  20.         ItemsT.Add(additem)
  21.         ViewState("items") = ItemsT
  22.         TextBoxCount.Text = ""
  23.         EasyListBoxItemT.ClearSelection()
  24.  
  25.  
  26. Public Class ItemInf
  27.     Public itemID As Integer
  28.     Public _Name As String
  29.     Public _Code As String
  30.     Public _count As String
  31.     'Public Sub New(ByVal itemid As Integer, ByVal name As String, ByVal code As String, ByVal count As String)
  32.     '    Me.itemID = itemid
  33.     '    Me._Code = code
  34.     '    Me._count = count
  35.     '    Me._Name = name
  36.     'End Sub
  37.     Public Property ID() As Integer
  38.         Get
  39.             Return itemID
  40.         End Get
  41.         Set(ByVal value As Integer)
  42.             itemID = value
  43.         End Set
  44.     End Property
  45.     Public Property Name() As String
  46.         Get
  47.             Return _Name
  48.         End Get
  49.         Set(ByVal value As String)
  50.             _Name = value
  51.         End Set
  52.     End Property
  53.     Public Property Code() As String
  54.         Get
  55.             Return _Code
  56.         End Get
  57.         Set(ByVal value As String)
  58.             _Code = value
  59.         End Set
  60.     End Property
  61.     Public Property count() As String
  62.         Get
  63.             Return _count
  64.         End Get
  65.         Set(ByVal value As String)
  66.             _count = value
  67.         End Set
  68.     End Property
  69. End Class
  70.  
  71.  
  72.  
But i got this error :
Type 'ItemInf' in Assembly 'App_Code.pnpn31qh, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable

any sugestion ??
Feb 8 '09 #1
2 11541
r035198x
13,262 8TB
Well, if at any point in your program you require objects of type ItemInf to be serialized than you need to mark the class ItemInf as serializable.
Feb 9 '09 #2
yes i found out i just should add <Serializable()> _ above the class
Feb 9 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: David Elliott | last post by:
I have a 3rd Party DLL that is a Win32 NOT .NET Assembly that is misbehaving. I am trying to isolate it in its own AppDomain. I got to load but can not create an instance. I receive the following...
3
by: Barguast | last post by:
Has anyone got any idea what might be causing this message to be shown? It occurs whenever I try to copy / cut my custom control from the Form Designer: ...
1
by: Harshdeep Mehta | last post by:
Hi all, I have written a page in which I want to preserve value of object - suppose A - value, so I used viewstate. but that give me error. Code : ViewState = objClassA; // Before PostBack...
2
by: jeffpriz | last post by:
I'm having trouble.. I created a small class that I pass to my Pages, and I want to put that class into Viewstate.. I do: Viewstate.add("thisVar", myClassVariable) and i receive the lovely...
2
by: Prakash | last post by:
Hi Friends, In my C# application, i have tried to serialize some structured data using Soapformatter. While calling the serialize funciton i got the exception message like "mscorlib....The...
1
by: Yogesh Parab | last post by:
In our application we havr presentation layer and business laye. The presentation layer interacts with business layer using webservice. We need to store the object from the Business layer in the...
2
by: Frank Uray | last post by:
Hi again I have a little problem with "serializable" a control ... I am creating AppDomain, Assembly and Instance. All works fine. My "base" class for the instance inherit from: -...
0
mmfranke
by: mmfranke | last post by:
Hello. Hi. I'm writing a logging service that uses .NET remoting. The idea is that the service publishes an EventProcessor object that clients can access via .NET Remoting, passing it...
5
by: Nirdesh | last post by:
Hi, I am serializing a custom class holding some data for my project. This data internally contains a class which contains an event public delegate void MemberModifiedEventHandler(object...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.