24-11-19, 11:30 PM
(آخر تعديل لهذه المشاركة : 24-11-19, 11:37 PM {2} بواسطة asemshahen5.)
تفضل هذا كود الحذف :
PHP كود :
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If MsgBox("هل انت متأكد من عملية حذف السجل : " & TextBox2.Text, MsgBoxStyle.YesNo + MsgBoxStyle.MsgBoxRight + MsgBoxStyle.MsgBoxRtlReading, "") = MsgBoxResult.Yes Then
Using cmd As OleDbCommand = New OleDbCommand(
"Delete From Table1 where [Name]='" & TextBox2.Text.Trim & "' and [Name] in (Select MyName From Table2 where Sum1=0 and Sum2=0) ", con)
If con.State = ConnectionState.Closed Then con.Open()
If (cmd.ExecuteNonQuery()) > 0 Then
MsgBox("تم الحذف", MsgBoxStyle.MsgBoxRight + MsgBoxStyle.MsgBoxRtlReading, "")
Else
MsgBox("لم يتم الحذف", MsgBoxStyle.MsgBoxRight + MsgBoxStyle.MsgBoxRtlReading, "")
End If
Form1_Load(Nothing, Nothing)
End Using
End If
End Sub
سبحان الله وبحمده سبحان الله العظيم و الحمد لله ولا اله الا الله والله اكبر
