Hi! I am new to C# programming and found this website a great resource for learning and growing. Currently, I am developing a windows form tracking contact information (employee ID, name, address, phone, etc) and I looking for the best practice to connect a text file to my windows form. The text file will be saved to disk after displayed on console to confirm accuracy of data entry. When addition data is entered into the form it will be appended to text file. I am looking at streamreader and streamwriter to handle this process. Am I moving in the right direction is there another resource to consider. Any advice, tutorial, article would be appreciated regarding this matter.
Thanks again for a great resource.
MB
Best practice to add txt file to windows forms
Page 1 of 13 Replies - 1457 Views - Last Post: 14 January 2013 - 02:32 PM
Replies To: Best practice to add txt file to windows forms
#2
Re: Best practice to add txt file to windows forms
Posted 14 January 2013 - 08:25 AM
Quote
I am looking at streamreader and streamwriter to handle this process. Am I moving in the right direction is there another resource to consider.
Yes that is the way to go.
Literally it's a three line job..
Create the writer
Write line
Close the writer.
http://msdn.microsof...reamwriter.aspx
#3
Re: Best practice to add txt file to windows forms
Posted 14 January 2013 - 09:37 AM
Quote
I am developing a windows form tracking contact information (employee ID, name, address, phone, etc) and I looking for the best practice to connect a text file to my windows form.
I'm going to stop you there because all of those things don't go together.
Tracking contacts and textfile are not anything close to best practices.
At the very least you should be objectifying your contacts (a Contact class object) then serializing it to XML instead of reading text files.
But it would be FAR FAR better to use a database for this. Visual Studio will let you build a program with a database as service so you don't have to install a database engine or anything. Its all there built-in for you already.
This post has been edited by tlhIn`toq: 14 January 2013 - 09:39 AM
#4
Re: Best practice to add txt file to windows forms
Posted 14 January 2013 - 02:32 PM
Quote
But it would be FAR FAR better to use a database for this. Visual Studio will let you build a program with a database as service so you don't have to install a database engine or anything. Its all there built-in for you already.
Wow for all this time, I did not know VS could do that
Awesome!
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote








|