locked
Problem with executing sql query in visual web dev 2008 RRS feed

  • Question

  • User-1139693770 posted
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Configuration
    
    Partial Class _Default
        Inherits System.Web.UI.Page
        Protected Sub btnUpdate_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim strConnString As String = ConfigurationManager.ConnectionStrings("PartsConnectionString").ConnectionString
            Dim con As New SqlConnection(strConnString)
            Dim cmd As New SqlCommand("UPDATE Parts SET Count=@Count WHERE [Product #]=@Product# END")
            cmd.Parameters.Add("@Count", SqlDbType.VarChar).Value = Text1.Text
            cmd.Parameters.Add("@Product#", SqlDbType.VarChar).Value = PartNum_dropdown.SelectedValue
            cmd.Connection = con
            Try
                con.Open()
                cmd.ExecuteNonQuery()
            Catch ex As Exception
                Throw ex
            Finally
                con.Close()
                con.Dispose()
            End Try
        End Sub
    
    
    
    
    
    End Class
    
    
    Gives me a syntax errror near the word "END"
    whats wrong?
    Thursday, June 2, 2011 11:27 AM

Answers

  • User-1139693770 posted

    NVM solved!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 2, 2011 11:29 AM