I have a BindingSource like so:
BindingSource.DataSource = DataSet.Tables("TableName")
My BindingSource.PositionChanged event is working great, but stops firing after this following code is run, and I'm not sure why:
'I'm trying to send my updates and then retreive any updates using this (very poorly written, I'm sure) code here.
Using DataAdapter As New MySqlDataAdapter("SELECT * FROM MyGreatTable", MySQLConn)
Dim myCommandBuilder As New MySqlCommandBuilder(DataAdapter)
CType(BindingSource.Current, DataRowView)("myTime") = Now
BindingSource.EndEdit()
DataAdapter.Update(DataSet.Tables("TableName"))
DataSet.Tables("TableName").Rows.Clear()
DataAdapter.Fill(DS.Tables("TableName"))
myDateTime = Convert.ToDateTime(DataSet.Tables("TableName").Compute("Max(myTime)", Nothing))
End Using
Does anyone know why this is happening?
Edit: Okay so as per Plutonix, I've removed DataSet.Tables("TableName").Rows.Clear(). I'm running into a different error now...