Hi,
Re ADO.net, I get the concept generally of DataSet and DataAdapter. What's not clear if I may ask is:
Q1 - What constraints are there on whether the database connection need to remain open or not? Can I close the connection but still work with DataSet? If so what needs to be in place to perform an update? Does the DataAdapter need to retain an active database connection?
Q2 - More generally if I wanted to, during the course of a user using a WinForms application was to have the user:
- Get initial data available in database (e.g. readin DataSet using DataAdapter), and then at some point of time later
- Add a new row to the database, and have it appear in the actual database (ie saved)
- Add another record (but just keep in memory/dataset)
- Some time later then SAVE the new row added from [3]
What would be the DataSet / DataAdapter / Connection things that one would need to do here? Would you have the database connection closed in-between all steps under the guidelines of minimizing keeping the database open?
Thanks