kenhamster
New Member
I have the following code to update an Access database in a datagrid.<BR><BR>Sub MyDataGrid_Update(Sender As Object, E As DataGridCommandEventArgs)<BR> Dim DS As DataSet<BR> Dim MyConnection As OleDbConnection<BR> Dim MyCommand As OleDbCommand<BR> <BR> MyConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=Cocuments and SettingsantelluserProjects estdbs_data.mdb;Persist Security Info=False")<BR> MyConnection.Open<BR> Dim Sql As String<BR> <BR> Dim ad1Text As TextBox = CType(e.Item.Cells(1).Controls(0), TextBox)<BR> <BR> dim s As String<BR> <BR> s = "update CliAddress set ad1='" & ad1Text.Text & "' where id=22"<BR> <BR> MyCommand = New OleDbCommand(s,MyConnection)<BR> Dim myReader As OleDbDataReader = myCommand.ExecuteReader()<BR> Response.write(s)<BR><BR> BindGrid()<BR> End Sub<BR><BR>This is the Update Sub routine. The problem is that when it updates it does not send the current data to the database but the previous data.<BR><BR>Can anyone help or direct me towards a good tutorial.<BR><BR>Many Thanks<BR><BR>Steve