31-08-19, 04:23 PM
جابلي مشكلة تانية
كود :
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If TextBox1.Text = "" Then
MsgBox("Client Name is Empty", MsgBoxStyle.OkOnly, Title:="warning")
Return
Else
'Try
If conn9.State = ConnectionState.Closed Then
conn9.Open()
End If
Dim cmd9 As New OleDbCommand
Dim pos As Integer = DataGridView1.CurrentRow.Index
Dim posNm = DataGridView1.Rows(pos).Cells("Cient_Name").Value
If MsgBox("Are you sure you want update " & posNm, MsgBoxStyle.Question + vbYesNo, Title:="Warning") = vbYes Then
Dim sql As String = "UPDATE mmm SET Feedback='" & TextBox6.Text & "', where Cient_Name='" & posNm & "'"
'conn9 = New OleDbConnection()
'conn9.ConnectionString = Constr9
cmd9.CommandText = sql
cmd9.Connection = conn9
'conn9.Open()
BindingContext(ds9).Position = pos
cmd9.ExecuteNonQuery()
End If
'Catch ex As Exception
'MsgBox("فشل في تعديل البيانات")
'Finally
conn9.Close()
'End Try
MsgBox("تم التعديل بنجاح")
End If
End Sub