Help me read/write to text file

  • Thread starter Thread starter Daniel Kaseman
  • Start date Start date
D

Daniel Kaseman

I want to make a program that has 3 textboxes for inputting: Name, ID,
Amount, and then when I click "Add Item" button, it adds it to a text file,
and shows up on the list box. When I close and reopen the program, the text
file should fill the listbox with the records.

How do I do this? Is this a "Sequential Access file" ?

thanks
 
Daniel,

without making things too complicated for what seems to be a relatively
simple app, why not use a database. you can use your three textboxes, bound
to three fields of a database (Access/Jet or MSDE2000 come to mind). You
could use a Grid to display the records in the DB rather than using a list
box to display lines from a text file.

you could even skip the textboxes and add the data directly to the grid.

HTH
Lee

PS - Of course, if you really want to use a text file, post back and we'll
work on this from a text file point of view.
 
But what if I don't have these programs?

lgbjr said:
Daniel,

without making things too complicated for what seems to be a relatively
simple app, why not use a database. you can use your three textboxes, bound
to three fields of a database (Access/Jet or MSDE2000 come to mind). You
could use a Grid to display the records in the DB rather than using a list
box to display lines from a text file.

you could even skip the textboxes and add the data directly to the grid.

HTH
Lee

PS - Of course, if you really want to use a text file, post back and we'll
work on this from a text file point of view.
 
Well, that could be a problem :-)

MSDE 2000 is free though:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnmsde/html/usingmsde.asp

http://www.microsoft.com/downloads/...03-c4ba-4d98-bb0b-2c9d6414071f&DisplayLang=en

And this is a link to a free tool for managing MSDE 2000:

http://www.asql.biz/DbaMgr.shtm

Though, even using a scaled back version of SQL Server, it does seem like a
bit of overkill for three fields of data, but....

it could be a great learning experience!!

Have a look at the above links. If you're interested, download and install.
If not, we'll go with the text file.

Cheers,
Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top