Killsoft Sugdok

how to update record in ms access using vb.net

Go down

how to update record in ms access using vb.net

Post by putayputay on Mon Mar 11, 2013 6:53 am

Try
Dim SqlQuery As String = "UPDATE FullNameTable SET FirstName = '" & txtFName.Text & "', MiddleName = '" & txtMName.Text & "', LastName = '" & txtLName.Text & "' WHERE ID = " & id & ";"
Dim SqlCommand As New OleDbCommand

With SqlCommand
.CommandText = SqlQuery
.Connection = conn
.ExecuteNonQuery()
End With
MsgBox("One record successfully updated.")
loadListView()
Catch ex As Exception
MsgBox(ex.Message)
End Try

putayputay
Newbie
Newbie

Posts : 10
Join date : 2013-03-09

Back to top Go down

Re: how to update record in ms access using vb.net

Post by giovhz on Tue Mar 19, 2013 9:02 am

putayputay wrote:Try
Dim SqlQuery As String = "UPDATE FullNameTable SET FirstName = '" & txtFName.Text & "', MiddleName = '" & txtMName.Text & "', LastName = '" & txtLName.Text & "' WHERE ID = " & id & ";"
Dim SqlCommand As New OleDbCommand

With SqlCommand
.CommandText = SqlQuery
.Connection = conn
.ExecuteNonQuery()
End With
MsgBox("One record successfully updated.")
loadListView()
Catch ex As Exception
MsgBox(ex.Message)
End Try

nice share
avatar
giovhz
Newbie
Newbie

Posts : 41
Join date : 2013-03-09

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum