I've eliminated all of my previous code and simply included the snippet that I pasted from this web-site. And I'm still getting the 2 errors. Is there something else that I need to do? See below for code snippet:
Private Sub YesButton_Click(sender As Object, e As EventArgs) Handles YesButton.Click
'
' If here, then Alert the HOH Volunteer
' TBD Temporary
Dim name As String = "Mudassar Khan"
Dim city As String = "Pune"
Dim constring As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As New SqlConnection(constring)
Using cmd As New SqlCommand("UPDATE Persons SET City = @City WHERE Name = @Name", con)
cmd.CommandType = CommandType.Text
cmd.Parameters.AddWithValue("@Name", name)
cmd.Parameters.AddWithValue("@City", city)
con.Open()
Dim rowsAffected As Integer = cmd.ExecuteNonQuery()
con.Close()
End Using
End Using
End Sub ' YesButton_Click
----- The 2 errors below ----
Severity Code Description Project File Line Suppression State
Error BC30002 Type 'SqlCommand' is not defined. HOHAdminWin D:\HOHAdminWin\HOHAdminWin\Alert.vb 54 Active
Error BC30002 Type 'SqlConnection' is not defined. HOHAdminWin D:\HOHAdminWin\HOHAdminWin\Alert.vb 53 Active