how to update record in ms access using vb.net
2 posters
Page 1 of 1
how to update record in ms access using vb.net
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
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
- Posts : 10
Join date : 2013-03-09
Re: how to update record in ms access using vb.net
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
giovhz- Newbie
- Posts : 41
Join date : 2013-03-09
Similar topics
» how to insert/add record in ms access using vb.net
» how to delete record in ms access using vb.net
» how to view record in ms access using vb.net
» help me vb.net whent try record in access 2013
» How to connect Ms Access to vb.net
» how to delete record in ms access using vb.net
» how to view record in ms access using vb.net
» help me vb.net whent try record in access 2013
» How to connect Ms Access to vb.net
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|