1 Replies - 2938 Views - Last Post: 16 August 2012 - 05:14 PM Rate Topic: -----

#1 KatMan   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 22-February 12

Using DataSets in VB.NET 2010

Posted 16 August 2012 - 03:49 PM

This explanation might be quite lengthy for the point I'm trying to make, so bear with me...
I am building an application that will enable a user of the program to enter personal details for people (ex.: Contacts, or Friends...) and store them to a delimited text (*.txt) file. I have already done this, and made it work, but I am making a new version with more features. Previous version had the ability for the user to fill in the text boxes and click a "SAVE" button to store the data to the text file. However, the user had to open the text file (it was named "user_info.txt") to view the entries. Each time you clicked save, the text in the boxes would be appended so all previous entries were not overwritten.

In the new version, I would like to implement the ability for the user to save, view, and modify the entries from within the same Program.

What I want is this: Drop-down menu for last name (viewing only) to select the line of data, text box for last name (create/modify only), text box for First Name, etc., etc.,...

I was told by another member a rough way of doing this, but the more specific things, for example, of how to use what he mentioned, are a bit beyond my capacity at the current moment. I am writing in VB.NET 2010, and I am scavenging trying to find out how to use datasets (or arrays if it will do the same thing while being easier).

http://msdn.microsoft.com/ has been a fairly helpful resource, but it doesn't give me specific enough details in most situations. I got pretty good with Javascript simply by finding snippets of code, breaking them down into their most basic components, and trying to figure out what each of the most basic pieces of code did and how I could use them for what I wanted, not what the author has used them for. This proved very difficult, but was my second way of attempting to learn the language. I tried tutorial after tutorial, but I did not get enough information. Just examples and general info, which is not enough.

Back to the arrays and data sets.... The member told me to use a StreamReader to retrieve all the data line by line, sorting it into some sort of a collection using data sets or arrays. I don't know how to do this (neither of them; arrays, nor data sets), and, as I mentioned, msdn.microsoft.com proved to be more of a headache than a help (also one of his suggestions, if I remember correctly). Any Help (especially quick responses (are)) is much appreciated.

Thank you in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Using DataSets in VB.NET 2010

#2 _HAWK_   User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Using DataSets in VB.NET 2010

Posted 16 August 2012 - 05:14 PM

Datasets are containers for datatables and typically used for databases. Arrays would be difficult since there is more then one data field. A custom class that contains the properties for each field your setting would work well with a List(Of <this custom class>). StreamReaders work well text files and you could also move to XmlSerialization with the custom class design.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1