تحان



Imports System.Date
Imports System.Date.SqlClient


Dim connection As New SqlConnection("al rabt")

 Dim query As String

query = "insert into Patient values ('" & IDTEXTBOX.Text & "', '" & NAMETEXTBOX.Text & "', '" & PHONETEXTBOX.Text & "')"

query = "delete from patient where ID = '" & TextBox1.Text & "' "

query = "Update patient set name='" & TextBox2.Text & "', Phone = '" & TextBox3.Text & "', where ID = '" TextBox1.Text & "' "



Dim command As New Sqlcommand(query, connection )

Try

connection.open()
If (command.ExecuteNonQuery () <> 0) Then
MsgBox("Success")
Else
MsgBox("Query is executed no were deleted")
connection.Clouse()
Catch ex As Exception
connection.Clouse()
MsgBox("Failure")
End try

End sub

End class