I have a very simple DataSet linked to a ListBox. I need the User to be able to add Data and have used the following code (in a ToolStrip command button):
Dim newFileRow As DataRow = Database1DataSet.Tables("tbl_Files").NewRow() newFileRow("File Name") = fleName newFileRow("File Path") = flePath newFileRow("Times Opened") = 0 newFileRow("Last Opened") = DateTime.Now Database1DataSet.Tables("tbl_Files").Rows.Add(newFileRow)
This seems to work ok - the new Data immediately appears in the ListBox. However, as soon as I close the form all of the Data in the DataSet is lost. Does anyone know what I'm doing wrong?
Thanks for looking, Chris.