Arkadaşlar Ben şimdi program üzerinden mysql ile Kullanıcıların kendi bilgilerini güncellemesini istiyorum , Kullanıcı örnek verirsek mail adresini güncellemek istiyor Bunu Altta Resimler ile anlatıyor , sadece veri güncellemede takıldım Bana Yardım edip bunu geliştirirsek sevinirim
:RpS_thumbup:
internette bulduğum son kodlar hemen alttadır
Sub ChangeSelectedSubjectName()
Try
conn.Open()
' Setup the command object.
Dim cmd As New MySqlCommand
' Notice how we pass the connection variable to it?
' This associates the command object with its connection to run queries against
cmd.Connection = conn
' Next we tell it the query to run
If ListBox1.SelectedItem = TextBox2.Text Then
'No need to update column.
ListBox1.Items.Clear()
Else
cmd.CommandText = "UPDATE `teacher_subjects` SET `holdnavn` = '" & TextBox2.Text & "' WHERE `teacher_subjects`.`ID` = " & subjectID.Text & ";"
ListBox1.Items.Clear()
End If
' Lastly we execute it
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Error While retrieving records On table..." & ex.Message, "Load Records")
Finally
conn.Close()
LoadSavedSubjects()
TextBox2.Visible = False
Button5.Visible = False
Button1.Enabled = True
Label1.Visible = True
End Try
End Sub
Try
conn.Open()
' Setup the command object.
Dim cmd As New MySqlCommand
' Notice how we pass the connection variable to it?
' This associates the command object with its connection to run queries against
cmd.Connection = conn
' Next we tell it the query to run
If ListBox1.SelectedItem = TextBox2.Text Then
'No need to update column.
ListBox1.Items.Clear()
Else
cmd.CommandText = "UPDATE `teacher_subjects` SET `holdnavn` = '" & TextBox2.Text & "' WHERE `teacher_subjects`.`ID` = " & subjectID.Text & ";"
ListBox1.Items.Clear()
End If
' Lastly we execute it
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Error While retrieving records On table..." & ex.Message, "Load Records")
Finally
conn.Close()
LoadSavedSubjects()
TextBox2.Visible = False
Button5.Visible = False
Button1.Enabled = True
Label1.Visible = True
End Try
End Sub
Çözdüm gerek kalmadı zaten cevapta gelmedi
Moderatör tarafında düzenlendi:
