|
-
Jul 22nd, 2018, 12:46 PM
#1
Thread Starter
Junior Member
Vb.net - Query Update [Microsoft Access]
Hello everyone,
when I want to edit values in the datagridview and then click on my save button, it does not save the edit in my access table.
Could someone say me what did I wrote wrong.
Thanks in advance!
My code is this :
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i As Integer = ArbeitDataGridView.CurrentRow.Index
Dim Planer As String = ArbeitDataGridView.Item(1, i).Value
Dim ProjektName As String = ArbeitDataGridView.Item(2, i).Value
Dim Priorität As String = ArbeitDataGridView.Item(3, i).Value
Dim Datum As Date = ArbeitDataGridView.Item(4, i).Value
Dim Beschreibung As String = ArbeitDataGridView.Item(5, i).Value
Try
ArbeitTableAdapter1.UpdateQuery(ProjektName, Priorität, Datum, Beschreibung, Planer)
Me.ArbeitTableAdapter1.Fill(Me.Arbeitseinstellung.Arbeit)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
My query :
UPDATE Arbeit
SET Projektname = ?, Priorität = ?, Datum = ?, Beschreibung = ?
WHERE (Planer = ?)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|