Hi,
I'm having a problem getting my datasource (SQL Server 2005) to committ changes. I think I'm probably not close() or dispose() correctly, but I'm not sure. Here's what I have:
I have a form (frmList) that contains a list of data from a database table (tblData). I also have a form that I can enter the data into (frmData). It's loaded as a dialog window.
Basically, frmList loads and displays all the records from tblData. When I click on a button, frmData loads. When frmData loads, it creates a record in the database, binds it to frmData. I have a Dataset, tableadapter, binding source etc. all setup on frmData. In the FormClosing() method of frmData, I call a Load_Items() method on frmList to populate the list.
When I call the Load_Items() method from frmData, the newest item doesn't show up right away. I created a button on frmList that calls the exact same load_items method. If I close frmData (the data doesn't show up), but if I click the button, it does. I thought maybe there was a committ delay, so I waited 1 second and that didn't work either.
I'm thinking there is a command / method that is not committing the changes until I close the form..... anyone know what that is?
I'm disposing all connections, DS, BS, TA, etc.
Here's my FormClosing() code:
bsItems.EndEdit()
tatblData.Update(dsData.tblData)
tatblData_Property.Dispose()
bsItems_Property.Dispose()
dsData_Property.Dispose()
frmList.Load_Items()
TIA,
John