Try
conn.Open()
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try
End Sub
'Handling the delete btn
Private Sub Delete_Btn_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Delete_Btn.Click
Dim delStr As String = _
"delete from Employees where EmployeeID='" + _
Me.EmpID_Txt.Text + "'"
Dim conn As New _
SqlConnection(System.Configuration.ConfigurationSettings.AppSettings(_
"ConnStr"))
Dim cmd As New SqlCommand(delStr, conn)
Try
conn.Open()
cmd.ExecuteNonQuery()
Finally
conn.Close()
End Try
End Sub
'Handling the update btn
Private Sub DataUpdateButton1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles DataUpdateButton1.Click
Dim updateStr As String = "update Employees set LastName='" + _
Me.LastName_Txt.Text + "',FirstName='" + _
Me.FirstName_Txt.Text + "',Title='" + _
Me.Title_Txt.Text + "',City='" + _
Me.City_Txt.Text + "',Country= '" + _
Me.Cntry_Txt.Text + "',HomePhone='" + _ |