Click here to Skip to main content
15,881,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hiii all...
I have an arraylist with user define data type...
and i need to send it trough LAN.
I am using WCF for communication and I know I have to convert arraylist to memorystream to send data...
I hve tried this method

C#
ArrayList history = ie.getHistory();
BinaryFormatter f = new BinaryFormatter();
MemoryStream ms = new MemoryStream();
f.Serialize(ms, history);


but I gives error because of user define data type...
help
thanks
Posted
Comments
Al Moje 8-Sep-11 23:40pm    
I think you must specify first what is the content of you ArryList. Is this an interger or a byte[]
or any of type...
XeeShaN AbbAs 9-Sep-11 12:55pm    
my array list has multiple columns and each column contains user define datatype... not abstract datatype...
CS2011 8-Sep-11 23:57pm    
Can you tell what is the error message it's giving ?
XeeShaN AbbAs 9-Sep-11 12:58pm    
its not error it throws exception that
"Type 'UrlHistoryLibrary.STATURL' in Assembly 'UrlHistoryLibrary, Version=1.0.4146.25771, Culture=neutral, PublicKeyToken=null' is not marked as serializable."

on that line of code f.Serialize(ms,history);

1 solution

Did you apply the serialization attribute for the data transfer array content
C#
[Serializable]
 
Share this answer
 
Comments
XeeShaN AbbAs 9-Sep-11 12:53pm    
no i dont..??
how could i do that...???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900