K
Katty
I'm trying to update a Table wich has Text and Boolean values. Text values
are updated without any problem, but changes on boolean value doesn't show
until restarting the application. It's an Access database, here's the code,
What am I missing here?
Function GetRow() As DataRow
Dim bm As BindingManagerBase
Dim drv As DataRowView
bm = BindingContext(Me.DataSet1, Table)
drv = CType(bm.Current, DataRowView)
GetRow = drv.Row
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim drCurrent As DataRow
Dim cmdUpdate As System.Data.OleDb.OleDbCommand
Dim casa As Boolean
cmdUpdate = Me.DataAdapter.UpdateCommand
drCurrent = GetRow()
Me.daEmpresas.UpdateCommand.Parameters("Name").Value =
drCurrent.Item(0)
Me.daEmpresas.UpdateCommand.Parameters("Phone").Value =
drCurrent.Item(1)
'''''''''''''''Boolean Value is actually set to True, I'm trying to change
it to False and even doing it directly doesn't work
Me.daEmpresas.UpdateCommand.Parameters("Other").Value = False
Me.daEmpresas.UpdateCommand.Parameters("Date").Value = Now.Date
Me.daEmpresas.UpdateCommand.Parameters("Original_Name").Value =
drCurrent.Item(0, DataRowVersion.Original)
Me.OleDbConnection1.Open()
cmdUpdate.ExecuteNonQuery()
Me.OleDbConnection1.Close()
End Sub
are updated without any problem, but changes on boolean value doesn't show
until restarting the application. It's an Access database, here's the code,
What am I missing here?
Function GetRow() As DataRow
Dim bm As BindingManagerBase
Dim drv As DataRowView
bm = BindingContext(Me.DataSet1, Table)
drv = CType(bm.Current, DataRowView)
GetRow = drv.Row
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim drCurrent As DataRow
Dim cmdUpdate As System.Data.OleDb.OleDbCommand
Dim casa As Boolean
cmdUpdate = Me.DataAdapter.UpdateCommand
drCurrent = GetRow()
Me.daEmpresas.UpdateCommand.Parameters("Name").Value =
drCurrent.Item(0)
Me.daEmpresas.UpdateCommand.Parameters("Phone").Value =
drCurrent.Item(1)
'''''''''''''''Boolean Value is actually set to True, I'm trying to change
it to False and even doing it directly doesn't work
Me.daEmpresas.UpdateCommand.Parameters("Other").Value = False
Me.daEmpresas.UpdateCommand.Parameters("Date").Value = Now.Date
Me.daEmpresas.UpdateCommand.Parameters("Original_Name").Value =
drCurrent.Item(0, DataRowVersion.Original)
Me.OleDbConnection1.Open()
cmdUpdate.ExecuteNonQuery()
Me.OleDbConnection1.Close()
End Sub