Serialization - Serialize / Deserialize With References
Dec 5, 2011
I have a 2 collection of varying objects. Let's say I have the following two objects Private col1 as Collection(Of A) and Private col2 as Collection(Of B) But object of Type A has a collection of Type B as an Attribute. so A looks like that
[Code]...
View 1 Replies
ADVERTISEMENT
Jan 13, 2011
I am trying to read in an XML document, add a record with a tag for the filename and write to a different XML document.I have been told I must use serialization.
View 2 Replies
Mar 31, 2009
I have an XML document that I am deserializing (VB .NET 3.5 Framework), changing some values, and the serializing again. The original document has several XML Comments in it. When I go through all the deserialize/serialize all of the comments are lost. Is there a way to preserve the comments? If not, is there a way to add comments on serialization without having to walk through with the writer and manually add all of the comments back in the appropriate place?
View 1 Replies
Aug 7, 2010
How do I serialize and deserialize my main form (and its controls, subcontrols, their values, etc.)? Edit, for clarification. Currently I am writing the current value of each control to an .INI file, one by one and reading it back when the program is next run. Every time I add a new control, I have to remember to update that save/load .INI code.I just wondered if I can do it in one call, or a simple for loop iterating over all controls on the form.Btw, I use only simple controls like edit box, radio button, combo box, checkd listbox, the most complex thing I have is a datagrid, but even that is not linked to a databse.Accepted answer "can't. I will probably code my own, along the lines of ...
[code]...
maybe later add left/top/height/width/enabled/visible, etc, bu tfor not th econtrol name an its "value" are enough (text, value, lines, checked?, etc)
View 2 Replies
Aug 3, 2009
Is it possible to serialize and deserialize a structure?
I think it isn't because the code I use will not work for a structure but it does work for other data types like an array, string etc
View 3 Replies
Jun 11, 2009
I'm trying to serialize/deserialize data in vb. I've made a .dat file from a blank plain text file (not sure if this is suitable) which seems to connect ok, as do both the classes. Here's the
Imports Microsoft.VisualBasic.ControlChars
Imports System.IO
Imports System.Runtime.Serialization.Formatters.Binary
[Code]....
View 6 Replies
Jan 26, 2012
I am trying to write a class to serialize/deserialize something as simple as:
<table border="1">
<tr>
<td>row 1, cell 1</td>
[Code]....
I just can't get it to serialize to this thing. I tried to generate the class using xsd but that produced a lot of garbage code and I really would like to maintain this by hand as it is easier than the monstrosity that xsd produced which didn't work anyway.
View 3 Replies
Oct 19, 2010
Reading binary data out of the database, and I need to convert it back into a Digital Persona fingerprint template. I'm not familiar with serialization and deserialization, Here's what I tried:
Dim rsBioData As SqlDataReader = SQL.ExecuteReader
Dim byteTemplate As Byte
Dim memStreamTemplate As MemoryStream
If rsBioData.HasRows Then
While rsBioData.Read
[Code] .....
I receive an error that template.DeSerialize(memStreamTemplate) does not create a value.
Here's how I serialized the object to place it into the database. I assume this part is working, since the binary data shows up in SQL server--just can't read it back out to see.
Dim str As New MemoryStream
Enroller.Template.Serialize(str)
Dim serializedTemplate As Byte() = str.ToArray()
SQL.Parameters.AddWithValue("biometricData", serializedTemplate)
View 1 Replies
Apr 17, 2012
I have an ArrayList in android that I'm trying to convert to a Base64 String, then passing that to a wcf service though JSON and the wcf service inserts the string into a database. Then I need to be able to read that from the database and deserialize it in a .NET application.
This is how I am serializing the ArrayList in android:
private String convertByteArrayToSave(byte[] b){
if(b != null){
return Base64.encodeToString(b,0,b.length,Base64.DEFAULT);
}else{
[Code]...
The ultimate goal is to be able to be able to create a list of these shapes in the .NET app or android app and be able to read the list in the .NET app and android app no matter where it was created from. I'm able to it when you create the Shape from .NET and read it into android using WCF but creating it in android.
View 1 Replies
Nov 15, 2010
I have a question about serializing a Picturebox and it's child controls. I have a picturebox on my main form where a user can put new Picture boxes in.To a add a new Picturebox I say: Pictureboxmain.controls.add(Picturebox)But now I want to serialize this in a stream of bytes. I know that you can serialize an Arraylist as followed:[code]But is the same possible with a collection of controls?So now I tried this assuming the same method can be used with a control collection:[code]
View 9 Replies
Nov 4, 2010
Module ProjectSerializer
Sub Serialize(ByVal strPath As String, ByVal ProjInfo As ProjectInfo)
' create a filestream to allow saving the file after it has
' been serialized in this method
[code]....
View 7 Replies
Aug 3, 2010
I'm implementing some custom serialization (to byte array), and have run into a problem handling circular references.Example:
Class A
public MyBs as new List(of B)
End class
Class B
public MyParent as A
public MiscInt1 as integer[code]....
If I know that an instance of B will only ever be serialized through the serialization of an instance of A, then I can handle the setup of the MyParent reference from the instance of A and not even record that information inside the byte buffer for the instance of B.This doesn't feel quite right, but it might be the best solution.
View 1 Replies
Mar 1, 2012
The general idea of whats going on is i am trying to transfer a structure from one project to another using binary and sending through a TCP Stream. What I Did:In my server i serialized the structure Maps(Map) to a temp file. Then I read all the bytes from the temp file to my buffer and sent it off to my client project.
[Code]...
View 5 Replies
Aug 17, 2010
If a class is serialized and has events fired from it that are handled on a form you get the error "Form1 cannot be serialized" in c# you can use (to work around this):
[Code]....
View 1 Replies
Mar 9, 2011
I have Crystal Reports 2008 installed on my win7 laptop but when i go to insert references from my application settings the CrystalDecisions references are missing and im not able to find them. Note: they do exist in my "c:windowsassembly" folder.
View 3 Replies
Sep 17, 2009
I've been using XML serialization for a while, and today I realized something really odd. If I have a new line right after a "dot" (.), when i deserialize, I lose the dot. Has anyone ever had this happen to them? The following is my serialization code:
[Code]...
View 2 Replies
Nov 24, 2011
I have two experimental web services. One is an asmx contained within a .net web application. The other is a WCF service library being invoked from the web application.The asmx basically does everything I need, but I think WCF would be better, except that it doesn't do anything as I would expect after fiddling with the asmx service.For example, the same method behaves differently in each:
' ASMX
<WebMethod(BufferResponse:=True, EnableSession:=False)>
Function Test(aObject as Object) as Object
' object will have been successfully serializaed into a dictionary
[code]...
View 3 Replies
Dec 17, 2010
I can't find any example about how to deserialize AMF in vb.net. I found one in C# but i don't know how to make it working for VB. Someone is able to show me an example of parsing AMF, simple client?
View 5 Replies
Nov 3, 2011
HTML Dim Geocache As FileStream = New FileStream("c:emps.gpx", FileMode.Open)Dim serialize As XmlSerializer = New XmlSerializer(GetType(Cache_Location))Dim myLocation As Cache_Location = New Cache_Location
[Code]....
View 2 Replies
Jun 29, 2012
Ok, so I'm playing with some FTP profile files that are written in XML. I'm trying to get the program to be able to read the current users settings and fill in or remove servers they do or don't have access to. So the XML looks like
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ftp>
<servers>
[code].....
it's probably more cosmetic than anything but the logic just doesn't flow to look over 'server' and not 'servers'?!
View 8 Replies
Feb 25, 2012
I am trying to deserialize a JSON string using VB.net and cannot seem to pull the values out of the finished List.[code]I am told "Index was out of range. Must be non-negative and less than the size of the collection."
View 1 Replies
Sep 13, 2011
I'm having an issue with getting some of the values from with this json string:
{
"kind": "shopping#products",
"etag": ""YZWJaKE3MHROIW8rCIlu9mAACLM/6qxBB-GwuSPy5L3_zVS6sS2NYFI"",
"id": "tag:google.com,2010:shopping/products",
"selfLink": "https://www.googleapis.com/shopping/search/v1/public/products?country=US&
[code]....
View 2 Replies
Mar 18, 2011
I'm new to VB and trying to write a webservice that exports and imports JSON.I'm using JSON.NET 3.5 and can serialize fine:My Token class is:
<DataContract()> _
Public Class Token
<DataMember()> _
Public TokenID As String
<DataMember()> _
Public Issued As Date
[Code]...
View 1 Replies
Feb 23, 2010
We are trying to consume WCF service which returns employee details in JSON Format.like:
{"d":[{"_type":"Employee:#","BigThumbNailURI":null,"ID":1,"Name":"E1"},{"_type":"Employee:#","BigThumbNailURI":null,"ID":2,"Name":"E1"}]}
From VB.net code behind when I am trying to deserialize it it's stating that "Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''."
View 2 Replies
Oct 29, 2010
How do you deserialized a serialized object?I'm trying to extract the serials of fingerprint template which will be stored to the database. Here is my
Dim features As DPFP.FeatureSet = ExtractFeatures(Sample, DPFP.Processing.DataPurpose.Enrollment) <--- Serialized Object
And here is my sad failure attemp:
SetText(String.Format("Stat: {0}", features.DeSerialize(WHAT SHOULD I PUT IN HERE????)))
View 1 Replies
May 26, 2011
I am trying to deserialize my data and I keep getting an error.I'm hoping for any ideas of what could be the problem.My code in Visual Basic Express 2010:Imports System.Xml.Serialization
Imports Systm.IO
Public Class Form1
Structure gro
[code]....
View 2 Replies
Feb 13, 2012
For recent checkins it is pretty straightforward:
Dim UserSelfCheckins As FourSquare.UserSelfCheckins.Root
Dim ser As New JavaScriptSerializer()
UserSelfCheckins = ser.Deserialize(Of FourSquare.UserSelfCheckins.Root)(jsonstring)
[Code]...
View 1 Replies
Feb 1, 2011
I have a json array which is formatted as follows:
[Code]...
How can I deserialize this in such a way that I can have a list of objects indexed by property? Meaning, I want to be able to access the data like this: MyList(96).lastproperty or MyList(96).listofstuff.yetanother and have it return the proper datatype too? Is that even possible in vb.net?
View 2 Replies
Nov 14, 2011
I've the following JSON string to deserialize:
[{"application_id":"1","application_package":"abc"},{"application_id":"2","application_package":"xyz"}]
I'm using DataContractJsonSerializer method. It is made up of array of items and I couldn't find an example using VB.Net that can deserialize this structure. I have the following Application class to store this information:
<DataContract(Namespace:="")> _
Public Class ApplicationItem
<DataMember(Name:="application_id")>
[Code] .....
View 1 Replies
Mar 3, 2009
I'm new to VB and trying to write a webservice that exports and imports JSON.I'm using JSON.NET 3.5 and can serialize fine:
My Token class is:
<DataContract()> _
Public Class Token
[code].....
View 4 Replies