What are my options when it comes to storing values in VB.Net


I need some help with storing some values in VB.NET.

I am using Visual Studio 2012 Pro.

I have a datagridview on one of my forms which is being linked to an access 2010 database and I would like the user to select (highlight) one of the "rows" in the DGV which contains values in 5 columns and click a button called next.

When this button is clicked I want the values of this row saved temporarily somewhere so that it can be used elsewhere in my application until I tell the code to clear it.

My question is where can the values be saved?

Example of what the stored values (rows) look like is below, essentially its only one block of information.

Animal: Dog
Color: White
Sex: Male
Legs: 4
Tail: Yes

At first I was thinking I could save the values as keys in the windows registry, but I am worried maybe it would be too much strain on the registry. So then I was reading about the “Resources” area in Visual Studio, but this area looks to be used for a different purpose such as locale and images.

So I would like to know what my other options are. The values will be different each time as it all depends what row in the DGV the user selects. All rows have an ID which is generated by access upon creation.

I would like if possible to store the values within my application, but NOT hardcode them.

Kindly advise of what options I have available to accomplish this and provide any resources I can use to read up on it.

Who is Participating?
Éric MoreauSenior .Net ConsultantCommented:
behind your datagridview, you surely have a DataTable (or a dataview or a dataset) to which you bind.

The DataSet can easily read/wirte to XML on disk. It is built in ADO.NET. Have a look at http://shabdar.org/c-sharp/120-read-write-xml-data-using-adonet-dataset-and-c.html for an example
KevinAuthor Commented:
Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.