How To Serialize And Save Application Data

Feb 9, 2010

I have searched for an answer for a long time now, both generally ont he web and in several forums including this one. There are many people who asks this or similar qusetions, but the answers are often hard to understand, and quite often are answers to something other than what was asked from the beginning.I know that there are many skilled programmers out there, but most are not great teachers. So here is what I need: I have constructed a program in which the user can write values in textboxes, choose from lists (comboboxes) and make some choices by checking checkboxes. The data in the lists comes from a database, but I don't think that is really relevant here. What I want is, when all the choices are made and when the textboxes, comboboxes and so on have data (text or numbers) in them, I want the user to be able to save this to a file (XML perhaps?).

To speak plainly and visualize this to you, think of a roleplaying game (RPG), and that you fill out a character form with details about your character. Of course you want to save all this, and at some point retrieve it to make changes when you level up. I am not all that stupid when it comes to programming, but I have never tried to do something like this. My applications have had a database engin behind the GUI, and all the saving was done in tables at the far end of everything. Now I want to save data to a file instead. I have tried to find books (or a good tutorial here on the web), but most answers are for C (++. #, etc), or else they are hard to understand.

Is there anyone here who can help me or point me in the right direction? I'm not asking you to do my work for me, but som examples that are valid and that will help me understand the process whould be nice. So far I have recieved good help here on this forum from nice people.

View 8 Replies


ADVERTISEMENT

Serialize The Data And Save It To Xml File?

Feb 26, 2011

I have a list with class user and I am able to serialize the data and save it to an xml file. However I just cannot figure out how I

can deserialize that .xml file and save the data into a new list.

The following is my code:

Dim Users As New List(Of User)
Dim objStreamWriter As New StreamWriter(filelocation)
For Each btn As Button In myNodeBtns

[Code]....

I want to read the data back from the file and save it into the mynodebtns list where I orginally took it from.

View 15 Replies

Serialize All The Available Local Variables And Save Them?

May 13, 2010

when an exception occures, I want to save the data available on the stack and log it. how can I serialize all the available local variables and save them?

View 1 Replies

VS 2008 Serialize A Class That Implements An Event That Don't Want To Serialize?

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

Save Data (some Text That User Type [as Password Etc]) And Save That Password On Same Location Where Is Application?

Dec 25, 2011

how to save data (for example some text that user type [as password etc]) and save that password on same location where is application. After saving I want to have also Load option so we can load saved data.

View 7 Replies

Serialize A Data Table In .net?

Apr 19, 2012

I'm trying to serialize a data table in vb.net:

Dim dt As New System.Data.DataTable

and for the serializer:

Dim js As JavaScriptSerializer = New JavaScriptSerializer()
dim jsonString as string
jsonString=js.serialize(dt)

when it serialize the data table on the last line,it got an error:

An unhandled exception of type 'System.InvalidOperationException' occurred in System.Web.Extensions.dll Additional information: A circular reference was detected while serializing an object of type 'System.Globalization.CultureInfo'I even make the simplest datatable with only 1 column and 1 row, but it just won't serialize it?

View 1 Replies

Serialize/deserialize Data In Vb?

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

Serialize Generic XML Data Across WCF Web Service Requests?

Jun 1, 2009

I've got a web app that sends a request to a WCF service. The WCF service gets a LINQ resultset (anon. ilist) and sends that in reply, back to the web app.In order to get it working quickly, inside the WCF app, i'm using copytodatatable and sending it to my web app in a DataSet.

My web app then takes the DataSet and writes it to xml, some xslt is performed and the resulting data is shown on screen. Perfect.

I'm still (relatively) new to WCF. I understand that sending DataTables/DataSets is a bit cumbersome. The web app wants the data in xml format (for the xslt operation), so I figured I'd get the WCF web service to do the DataTable -> xml work for me, and simply reply with a nice XmlDocument to the client webapp.However a XmlDocument cannot be serialized.

What's the best way of sending the XML data down to the client over wcf?

View 4 Replies

Exporting Data To Excel And Try To Save To A Folder Which Is In An Application?

Sep 2, 2009

I am exporting data to excel and try to save to a folder which is in my application...but the excel is saving defaultly in C:Documents but i wanted to save in E:ApllicationReports Here is my code to generate excel sheet

If ComDset.Tables(0).Rows.Count > 0 Then
Try
With Excel
.SheetsInNewWorkbook = 1

[code]....

View 1 Replies

Synchronizing Phone With Pc Through An Application To Save / Restore Data

Dec 28, 2011

I have developed an application on my phone to manage my money. I would like to create an application on my pc to get the local database from my winphone to be able to display informations... and have a backup. I would also like to be able to restore my data back to my winphone if there is a crash.

View 4 Replies

Serialize A Data Structure And Pass It To Another Report Via Parameter?

Jan 15, 2010

I'm trying to serialize a data structure and pass it to another report via parameter, and this line of code:

Dim s As New System.Xml.Serialization.XmlSerializer(GetType(System.Collections.HashTable))

Produces this error:

An error occurred during local report processing. The definition of the report '/myReport' is invalid. There is an error on line 22 of custom code: [BC30002] Type 'System.Xml.Serialization.XmlSerializer' is not defined.

How can I get around this? I have been able to use fully defined .NET classes in other lines of code, including the following:

Dim outStream As New System.IO.StringWriter()

and

Private colorMapping As New System.Collections.Hashtable()

View 1 Replies

Activate File Save Command [Copy Data From Another Application]?

Feb 16, 2012

I am running an application from my desktop as you see on the picture,and I don't know how to run File Save command on active form without mouse click,only with vb.application?

View 10 Replies

Save Application Data (input+output) In A New File Format In Program?

May 16, 2011

I work in an engineering design house and programming is not my actual profession. And I am relatively new to VB .net (previous i had worked in vb 6)

I am working on an in house application. I am coding a simple application in vb .net. This applications takes a few inputs from user and calculates a result. Now I want to implement a simple functionality that user should be able to save the input and results just like most of the windows programs can in a new file format. And user should be able to open the save file when desired.

View 10 Replies

DB/Reporting :: Save Button The Data Doesn't Show Up In The DataGridView Until Close The Application

Sep 21, 2009

I have a form that has around 4 txtboxes. Data is inserted into these boxes and then a "Save" Button is pressed. I have a GridView added to my form and want to view the entries. The issue I am having is that when I click the save button the data doesn't show up in the DataGridView until I close the application and then re open it.

[Code]....

View 8 Replies

Modify Code To Insert The Data To MS SQL And Save Changes When Click Save Button For The Second Time?

May 29, 2011

modify code to insert the data to MS SQL and save changes when click save button for the second time?

View 14 Replies

Insert & Update The Data Grid And Save The Changes When The Save Button Is Clicked?

Dec 27, 2010

how to code for the save button in vb.net datagrid view by using insert into sql and update sql statements (it should be able to insert & update the data grid and save the changes) when the save button is clicked .

View 2 Replies

Save All Data Displayed In DataGridview And Save It Using Oracle Client(ODAC 11g)?

Apr 20, 2010

How to save all the data displayed in DataGridview( 2 column, no primary key) and have a button and

View 7 Replies

Save The Data Of Dynamically Created Textbox On Clicking The Save Button?

Jun 18, 2012

I am working on desktop application. I had created number of dynamic textbox and label and I want to save that data on clicking the save button.

View 4 Replies

User Presses The Save Button To Save Data?

Feb 24, 2009

in my form i have 4 textboxes and i want all not to be empty while saving the data.I have put condition in save button,when user presses the save button to save data, to check all the textboxes not to be empty. My question is that, i want to focus to that particular textbox which is empty during saving the data.

For example: i have txt1,txt2,txt3,txt4 as textboxes in the form if txt1 is empty while saving, the focus should switch to txt1 rather user himself have to go there.

View 16 Replies

Can't Save Data To Install Folder - Can't Find Data After Written

May 19, 2011

I've written a very simple program that writes a tiny "config.cfg" (text) file to the computer (using StreamWriter), and a second program that is supposed to read that data back.

Unfortunately, it appears you can't save to the same folder as your program under Win7 ("Program Files (x86)" is a restricted folder.) So instead, VB automatically saves my data to the "C:Users(myname)AppDataRoaming..." folder. This is annoying, but tolerable.

PROBLEM IS: How does my second app then FIND my data file (without doing a time-wasting drive search every time the program is run?)

My code:

' Program #1:
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
Dim FileWriter As New StreamWriter("config.cfg")

[Code].....

View 2 Replies

Save Data In Access Data Base Using Rows And Columns Value?

Feb 9, 2011

I am trying to read and save data into a access Database but using the rows and colunms valeu can

View 1 Replies

Save Data Across Three Tables Using One Forms "Save" Button?

Mar 28, 2011

I have three tables under one database. I'm using the built-in Navigator control for now until I get this figured out, but I'm using a button command instead of the built in navigator button. I need the "Save" button to save the data in the text fill boxes to save to the corisponding table. I used the drag and drop option to drop rows from each table to the form. See code:

Private
Sub Button1_Click(ByVal
sender As System.Object,
ByVal e

[Code]....

View 3 Replies

Asp.net - 2 Arrays To Serialize?

Jun 23, 2011

I have the following code which works well:

Dim dept As New ArrayList
Dim forename As New ArrayList
objJSONStringBuilder = New StringBuilder()

[Code].....

Eventually, I will want to add more columns, i.e. surname.

View 2 Replies

Asp.net Mvc - How To Serialize Json .NET?

Apr 26, 2012

I am trying to call a rest service..that service returns json object...I am able to send the request but unable to serialize the json...here is the code i am trying

[Code]...

View 1 Replies

C# - How To Serialize Only Some Properties In .Net

Mar 15, 2010

This is for a web project so i have several classes that inherit from Web.UI.

I only want to serialize very particular properties (basically, only local properties)

I'm aware of the XMLIgnore property that can be placed on a property to ignore items, but this won't work in my context since that would require modifying a bunch of stuff that i really don't want to modify (and probably can't).

So how do i tell the xml serializer to ignore everything except for X and Y or tell it to seralize just X and Y?

i could just create my own xml in a string builder or something and if that's the only way, so be it. however i'm looking for a method that will employ the built in XML stuff.

View 3 Replies

DeSerialize And Serialize From XML To XML?

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

How To Serialize A Hashtable

Nov 2, 2009

I have a hash table in which the key is of type Point and the value is of type PieceOfBoard. PieceOfBoard is derived from PictureBox. How do I serialize this hashtable to save it to a file?Do I need to add anything to the PieceOfBoard class?

View 3 Replies

How To Serialize An Object Into XML

Oct 9, 2011

How can I serialize a .net object into XML and then de-serialize it back?

View 3 Replies

Serialize A Listview Using .net?

Nov 7, 2009

how to serialize a listview using vb.net

View 1 Replies

Serialize A Structure To XML?

Feb 27, 2010

I'm writing a test application in order to figure out how to serialize a structure to XML. I can not get the following code to work for me and it's not obvious to me.

The following defines the structures I am attempting to serialize. I think I have the xml decoration correct - but the errors I'm receiving (see below) don't really give me much information.

Imports System.IO
Imports System.Xml.Serialization
Public Module modTestSerialization

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved