473,699 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help me read/write to text file

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
Nov 21 '05 #1
4 1414
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.

"Daniel Kaseman" <da*@cfaith.com > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
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

Nov 21 '05 #2
But what if I don't have these programs?

"lgbjr" <lg***@online.n ospam> wrote in message
news:eM******** ******@TK2MSFTN GP09.phx.gbl...
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.

"Daniel Kaseman" <da*@cfaith.com > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
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


Nov 21 '05 #3
Daniel,

Have a look at these pages

http://samples.gotdotnet.com/quickstart/

I hope this helps a little bit?

Cor
Nov 21 '05 #4
Well, that could be a problem :-)

MSDE 2000 is free though:
http://msdn.microsoft.com/library/de.../usingmsde.asp

http://www.microsoft.com/downloads/d...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

"Daniel Kaseman" <da*@cfaith.com > wrote in message
news:u5******** ******@TK2MSFTN GP15.phx.gbl...
But what if I don't have these programs?

"lgbjr" <lg***@online.n ospam> wrote in message
news:eM******** ******@TK2MSFTN GP09.phx.gbl...
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.

"Daniel Kaseman" <da*@cfaith.com > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
>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
>
>



Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1782
by: Parker.Jim | last post by:
I need to write a program which performs word subsitutions on a text file. The program should input the names of three text files: the source file that will be "edited", a text file that contains the editing instructions, and a file that will contain the result of the editing.
6
4991
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
3
1722
by: Joshua Nunn | last post by:
I am reading in a text file of about 25 megs, using a streamreader class. Now this text file was generated using a DataBUS programming language, now known as PL/B, and being used as a database, that just happens to be a flat text file. What I need to be able to do is to read in a line from this text file, edit a few fields in this text stream (which I can do), and then write the editted line back out at the same formpointer position. I...
8
2744
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only the sequence nos and it should be such that i can access it through the structure .plz help me .
1
2178
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include <string>
2
2753
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include <string>
4
2199
by: naknak4 | last post by:
Introduction This assignment requires you to develop solutions to the given problem using several different approaches (which actually involves using three different STL containers). You will implement all three techniques as programs. In these programs, as well as solving the problem, you will also measure how long the program takes to run. The programs are worth 80% of the total mark. The final 20% of the marks are awarded for a...
5
1915
by: B. Williams | last post by:
I need some assistance with random access file processing. I have a function that I would like to change from sequential file processing to random access. Thanks in advance. void updatePower(string filename) { ifstream in(filename.c_str(), ios::in); int cnt = 0; // read all records into database until we reach the end of the file
3
1806
by: Porkie999 | last post by:
-----------------------------------------------------------------------QUESTION hi i am really stuck with this and its only a small problem. i want to be able to type ......... dsfsjfjsjjfs in User Box fjdjskfjds in password box www.thescripts.com in website box then i want to have a button which says "save" which then saves the 3 above pieces of text into a notepad file. So like I said I want to be able to type a login, password and...
3
2210
by: ibeehbk | last post by:
Hi. I have a form made in xhtml. I test via vbscript to make sure none of the fields are empty and properly formatted (ie email). All the regular fields work. However, I have two drop down menus that are SELECT elements (javascript-- one named arrivalcity and one named returncity). Basically they ask for a departure and return city and another menu appears with options based on that city. I can't seem to get the input from these fields in the...
0
8617
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7751
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2347
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.