|
-
Jul 16th, 2009, 11:38 AM
#1
Thread Starter
Addicted Member
Working with a database
I just got a simple question:
When you are working with a database, is it then possible to make the program save stuff, so when you close and open the program, it could etc. save a text in a textbox?
-
Jul 16th, 2009, 11:41 AM
#2
Re: Working with a database
You need to call the save-procedure in the Close_event 
What code do you have already?
-
Jul 16th, 2009, 11:51 AM
#3
Thread Starter
Addicted Member
Re: Working with a database
Explain, im new at this point. =)
I dont have any code, but i just wanted to now, how to save the things...
-
Jul 16th, 2009, 11:52 AM
#4
Re: Working with a database
I would suggest that you read the FAQ thread at the top of the Database Development forum and follow the relevant links for ADO.NET explanations and examples.
-
Jul 16th, 2009, 04:34 PM
#5
Hyperactive Member
Re: Working with a database
This is actually quite simple. When the user hits the close application button you want to simple write whatever information you need to your database and then close the application. So in your example saving a text box data what you'd need to do is on the close event write the text box data to your database then close out the application. When you open the application in the "on load" procedure just open a connection to your data base pull the information from the database and then write it to your text box.
-
Jul 16th, 2009, 05:10 PM
#6
Re: Working with a database
I have a question about the question: While it is possible to save the text from a textbox to the database, is that where the data ought to be saved?
Generally, programs that work with databases are written so that the user enters a few things, those few things are saved to the database when the user clicks a button, then the user enters a few more things, and so on. When you talk about saving the text in a textbox when the program closes, it makes me think that you just want to retain the current state of the program at the time that it was closed. This is done more easily using My.Settings than by saving the state to a database, though the database option would work.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|