473,396 Members | 2,089 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,396 software developers and data experts.

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 11539
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...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...
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...

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.