I badly wanna Serialize a Linked List into XML and deserialize it back when required. I didn't get proper results when i did google. But, I learnt through the following link that it's not possible to do so. [URL]
I have a Generic.List(Of ImportedVehicle) - ImportedVehicle being a simple class as below.There is an enum property which is marked as public.When I serialize to XML using an XMLSerializer, the enum's value is just set to it's default value (which is NotAllocated) and doesn't actually represent the value that is set in code.[code]
so i have a linked list of employee objects. I now need to iterate through the linked list to see if i can find a matching object. I could iterate though using the [code] What i'm not sure of is how i get the employees[x].EMID out to check it
I have a question about doubly linked list the uses student names and ages and creates them into node objects. the studentItem class is already created for me I just have to create the nodes that will hold each item entered. I am required to fill in the code needed for each function givien in the ICollections library that is setup for me. I dont know where to start out I'm trying to create a NodeLink class and from the class use the information to create the guts for the add function for my Nodelink Function I have the following:
Public Class NodeLink(Of T) Public node As T Public NextLink As NodeLink(Of T) Public PrevLink As NodeLink(Of T) Public Sub New(ByVal StudentItem As T) [Code] .....
I have been working on a number of card games. Important, of course, is shuffling the deck.I have come up with a few different ways to do this. Currently I do not shuffle, but to deal a card, I lay out the deck in order, selecting a random number between 1 and the number of cards remaining and selecting that card. I then remove that card from the deck so that another card can be picked.There are two main ways to do this, and I am trying to figure out which one is optimal.The first is to have an array of cards. When one card is dealt, a new array is formed with that card missing. I kind of like keeping the array size exactly the size of the deck, but perhaps this is not efficient. So, the first array has length n and the new array after the card is dealt has length n-1. VB.Net makes it simple to change array sizes around like this.
I am writing a small program to update data in a SharePoint list. Now where I cannot develop or use applications for SharePoint unless I am on a SharePoint server, I thought I would cheat the system by using Access to link to SharePoint lists, and then use Visual Basic to play with the Access tables. I need additional functionality other than what VBA can provide me, so that is why I am using the VB layer.Is it possible that this is not permitted? Whenever I try to update an item in the table, I receive the message:
"cannot update '(expression)'; field not updatable"
The word 'expression' here is not a filler I added, this is the actual error.If I try to make the edit manually in the table using Access, it works fine (I haven't tried it through Access VBA yet...).
How my code works is this:I have a Dataset added to the project which connects to the Access database. I add one of the tables to the dataset and create a Class object to reference the table adapter (essentially a Data Access Layer). I can read all of the data fine, and when a change is made in SharePoint, my application sees the updates when it refreshes. But when I try to write back to the table I get the error message above.
For Each r As DataRow In TableAdapter.GetData.Select("Name LIKE '*" & FileName & "*'")
There are other columns in the table and some of them have default null values. I only want to update these two fields, but it almost seems like this is not possible. I thought I might be somehow opening the Dataset in a Read Only mode, but I can't seem to find that option anywhere.
This overload resolution failed error that occurs when I try to add the newly created integer array as an item in a generic linked list as per the following?
Imports System.Collections.Generic Public Class GraphData Dim mInput As Byte() Public Data() As Integer Dim SignalData As New LinkedList(Of Integer)(Data) Private Sub Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint [Code] .....
- VS 2008 - Sharepoint 3.0 - Access 2007 - Windows Vista (The machine I'm developing it from)
History: (Do excuse me if I don't reference different methods I've taken so far correctly, I'm still learning!) I am building some search software for a law firm that I work for in Australia. It's all coming along really well, but I seem to have hit a snag getting data out of sharepoint lists and into my project!
I first attempted to add a web reference to sharepoint and after a while was able to pull in all of the data from the lists, fantastic!(OR NOT!). The issue then was when I attempted to load it up into an array using XMLNodes, whilst it loaded up fine and I could see all the data, if there was a null value in one of the columns, it wouldn't pull that null value across, therefore, I couldn't really use the data...
I am having problems with serializing and de serializing my objects.The following is my code for serializing buttons and labels which I have in my form.
Dim nodes As New List(Of nodeclass) Dim objStreamWriter As New StreamWriter(filelocation) For Each btn As Button In myNodeBtns Dim u As New nodeclass
I get an error: There is an error in XML document (20, 3).Now I have found out that this is because I have 2 root elements and 2 xml declerations. When I save the xml for the button and te xml for the label in 2 different files, I have no problem. However I have no idea how to go about saving the xml for both of them in the same file and deserializing it back.
I have just finished my application and am stuck as to how I'm going to store my data. As it stands I have multiple objects that I created but each of them take multiple ArrayLists as properties. I'm aware that this will give problems if I try to serialize my data?
I'm trying out MVVM in VB.Net for a while now and started out with some of my entities using List(of T)s, which I xml serialized to disk. Now, I updated the classes used by the Lists to implement INotifyPropertyChanged so I also changed the List(of T)s to ObservableCollection(of T)s.After which, the XML serializer stopped working :'( A colleague told me that ObservableCollections, unlike generic Lists, are not serializable.If so then how can I make them Serializable?
I'm not positive I'm going about this the right way. I've got a suite of applications that have varying types of output (custom defined types).For example, I might have a type called Widget:
Class Widget Public name as String End Class
Throughout the course of operation, when a user experiences a certain condition, the application will take that output instance of widget that user received, serialize it, and log it to the database noting the name of the type.
Now, I have other applications that do something similar, but instead of dealing with Widget, it could be some totally random other type with different attributes, but again I serialize the instance, log it to the db, and note the name of the type. I have maybe a half dozen different types and don't anticipate too many additional ones in the future.
After all this is said and done, I have an admin interface that looks through these logs, and has the ability for the user to view the contents of this data thats been logged. The Admin app has a reference to all the types involved, and with some basic switch case logic hinged upon the name of the type, will cast it into their original types, and pass it on to some handlers that have basic display logic to spit the data back out in a readable format (one display handler for each type)NOW... all this is well and good...Until one day, my model changed. The Widget class now has deprecated the name attribute and added on a bunch of other attributes. I will of course get type mismatches in the admin side when I try to reconstitute this data.
I was wondering if there was some way, at runtime, i could perhaps reflect through my code and get a snapshot of the type definition at that precise moment, serialize it, and store it along with the data so that I could somehow use this to reconstitute it in the future?
Possible Duplicate: Fastest serializer and deserializer with lowest memory footprint in C#?
I've been reading up on this whole subject, but I never came across this specific problem. I already understand that the whole idea of serializing an entire form is a horrible idea and just doesn't work. But, I am encountering a bit of a different problem. I have a class that inherits the "button" form object, that I call DataButton.
Now for my problem. I want to be able to serialize this class, but I don't need any of the information from the actual button class. Is there any way to bypass the fact that I can't set the button form object to Serializable() and notify VB that when serialization is to occur, it should simply skip over that information? Theoretically, if such a procedure were possible, I'd be able to do the entire serialization without a hitch.
I came up with the idea earlier of removing the "inherits" feature from the class, and having simply a button within the class, but that makes my program really difficult to work with as I am constantly changing the location, size, backgroundImage, text, and whatnot. Thus, immediate updates would be much tougher to work with.
Often it is very usefull to save data as a class by serialize and compress it. From few experiments I have noticed that Class A Public name as string Public List as new list(of string) <---- empty End Class
Class B Public name as string Public List as list(of string) <----- not instantiated End Class
If I serialize and compress the 2 classes the class B uses less spaces once serialized and compressed. This suggests me that if a class contains a list that is instantiated but empty it is better to set that to nothing and reset as new when it is decompressed and deserialized. Is there any dll that optimizes a class to be stored (serialized and compressed) and restore it when it is decompressed and deserialized?
I am sending XML externally. One of the node called "datafield" has an element called "value". This may contain normal text content, or an html content (which I need to wrap in CData). So, I created a base class (ProvisionDataField) with 2 classes inherits from it (ProvisionTextField, and ProvisionCDataField) as follows:[code]
I get an exception on the "Dim ser" line, saying "Testing.Module1 is inaccessible due to its protection level. Only public types can be processed." ("Testing is the name of the application, and "Module1" is the name of the module; this is a console application).
I am in the process of writing a base class for gadgets that will be displayed on a form.I want the gadget to be fully self contained and reusable.At this point it does everything that I need it to do EXCEPT, i'm having trouble figuring out a creative way to serialize my objects using only one object.I have a feeling the answer lies somewhere within the context of using shared functions but I'm having trouble wrapping my mind around it.
I apologise if this thread has been posted in the wrong section I was not certain whether it was the serialization or the networking that was causing this problem, but I feel that it is likely that it is the serialization.I am currently building two applications a client and a server, where several objects have to be sent between the applications, a couple objects each way.The applications are called "ACME Server" and "ACME Client" (yay for originality).
While I can get the first object to be transferred from the client to the server, but I can't get the second object to be transferred successfully from the server to the client, the error is occurring in the client program, I have taken a printscreen of the error that I am receiving, which I have uploaded to [URL]..All objects that are being sent are serializable (well there is an Interface called Action which I am unable to make serializable I believe due to it being an Interface).
Surprised this question has not been asked yet here, but here goes: Serialization in VB.NET is a bit of a pain. If you use the standard Serializable() attribute, and attempt to serialize a class that has events which are attached to handlers, it will attempt to serialize the handlers as well. Coming from a C# background I am not used to dealing with this problem, and the best solution I can find is using a class off of CodeProject.
I am trying to create a load and save function for my customizable Menu/Tool/StatusStrip controls (see signature). Those three controls use a single AppearanceControl class, which is mainly just a large list of properties (Colors) which control the colors of the Menu/Tool/StatusStrip.
I want to be able to save and load the values of these properties so the user can store them and load others with ease. Serialization seemed the obvious answer, although I never used it before.
Now, there is a slight problem that I cannot serialize Colors, so I simply gave each Color property the XmlIgnore attribute, and created an Integer property that gets and sets the Color property (using Color.ToArgb and Color.FromArgb). This way I can serialize the color properties succesfully.
Then, there is another problem. The properties are not all in the AppearanceControl class. Instead, the AppearanceControl class has a large number of subclasses, which in turn contain the color properties.
As a small example, I may have this:
vb.net Public Class AppearanceControl Private _toolStripColorProperties As ToolStripColorProperties Private _menuStripColorProperties As MenuStripColorProperties