Hello,
Iam learing Visual Studio 2008 C# and iam making a window where I can type in how much money i spend each week.
I want this information to save somewhere so I can see how it changes from week to week.
My question is, should I connect my form to an database to be able to do this? Or can this be done in other ways?
Also, what databse should I use if I need one. (a free one ofcourse)
Thanks,
Save data question/help please.
Started by Kim2, Mar 03 2010 01:57 AM
6 replies to this topic
#1
Posted 03 March 2010 - 01:57 AM
|
|
|
#2
Posted 03 March 2010 - 06:46 AM
If it's just an amount can't you save it as a text file?
When you close the form call up the closing event and save what you wrote on the form to a text file.
On the formload event load the text file and display the contents in the textbox(or where ever you want to display it).
If you need more help I can show you some sample code.
When you close the form call up the closing event and save what you wrote on the form to a text file.
On the formload event load the text file and display the contents in the textbox(or where ever you want to display it).
If you need more help I can show you some sample code.
#3
Posted 03 March 2010 - 07:45 PM
If you don't want to have to save it to an outside file like a text file you can look into using the Resources section of your application (Pretty easy if you use Visual Studio 2008). This still creates a file but one out of reach for the average user of your program.
#4
Posted 03 March 2010 - 07:45 PM
If you don't want to have to save it to an outside file like a text file you can look into using the Resources section of your application (Pretty easy if you use Visual Studio 2008). This still creates a file but one out of reach for the average user of your program.
#5
Posted 08 March 2010 - 12:56 PM
You can use SQLite for small database. Well, if you know SQL or after you learn it of course ;)
csharp-sqlite - Project Hosting on Google Code
csharp-sqlite - Project Hosting on Google Code
#6
Posted 09 March 2010 - 05:53 AM
If I was doing something like that and I didn't want to use a database I would serialize the data and save it in an xml page. That makes working with strongly typed objects very simple in C#.
-CDG10620
Software Developer
Software Developer
#7
Posted 12 March 2010 - 09:29 AM
try this dude
1.Open Notepad
2.Type in the .LOG as the first line , save and close it
3.Reopen the file you will have Date and Time prefixed to the current line.
4.Go ahead and type the ammount spent. thats it. ;D
1.Open Notepad
2.Type in the .LOG as the first line , save and close it
3.Reopen the file you will have Date and Time prefixed to the current line.
4.Go ahead and type the ammount spent. thats it. ;D


Sign In
Create Account

Back to top









