Jump to content
Xtreme .Net Talk

Using a Collection for permanent data storage


Recommended Posts

Posted

I need to store a large amount of data in an easily searched and referenced way. After reading my VB.Net books, it seems like creating several Collections would fit my needs perfectly. However, I am not sure how one goes about creating Collections that would be permanent(ie not lose all the data in them every time the computer is shut down or the program is restarted. Can anyone help me with this? I am quite the beginner at programming VB.Net. Or if there is another(better) way of doing the above, please let me know.Thanks!

MRC

Posted

MRCP,

 

Don't use a regular collection. Although you could populate the collection, serialize it into text, and write the text stream to a file and reload it if neccessary.

 

Why do that when you can enjoy the benefits of good old fashioned ADO.NET?! (okay, maybe not so old fashioned.)

 

Just create a Typed DataSet, throw your information into it. Write the xml to a file, and reload it when needed.

 

You will get a whole lot of extensibility this way. Also, you also get a table stucture that will help you move your data to a database in the future.

 

Have fun.

Posted

Thanks for the response. I have Visual Studio.Net installed on my computer and have been using VB.Net through that to build my program. Is ADO.NET included with this or do I need to get additional software? If this is a dumb question forgive me, I am new at this. I had been considering getting Microsoft Access as I have heard this is often used to build databases. But if ADO.NET will work for me I will try that first, especially if it is already included in Visual Studio.Net. Thanks!

MRCP

PS If it makes a difference my program needs only to function at a local level, will not need to access or communicate with remote servers or via the Internet.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...