locked
could not find a part of the path RRS feed

  • Question

  • User669521406 posted
     Protected Sub AjaxFileUpload1_UploadComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AjaxFileUploadEventArgs) Handles AjaxFileUpload1.UploadComplete
            ' Getting the File Name 
            Dim filename As String = e.FileName
    
            ' Setting the path to upload Images
    
            AjaxFileUpload1.SaveAs(Server.MapPath("~/images/") & filename)
    
            ' Storing the relative path to store into images
            Dim Imagepath As String = "~/images/" & filename
            Using conss As New SqlConnection(_start)
                conss.Open()
                Dim sql2 As String = "Select AuctionID from Auction INNER JOIN Item ON Auction.ItemID = Item.ItemID Where Item.Name=@name "
                Dim myCommand12 = New SqlCommand(sql2, conss)
                myCommand12.Parameters.AddWithValue("@name", dbItem.SelectedItem.Text)
                myCommand12.CommandType = CommandType.Text
                Dim auctionid As Integer = Convert.ToInt32(myCommand12.ExecuteScalar)
    
    
                Dim sql1 As String = "INSERT INTO Images (Image,AuctionID) VALUES (@image,@Auction)"
                Dim myCommand1 = New SqlCommand(sql1, conss)
    
                myCommand1.Parameters.AddWithValue("@image", Imagepath)
                myCommand1.Parameters.AddWithValue("@Auction", auctionid)
                myCommand1.ExecuteNonQuery()
    
                Dim sql3 As String = "UPDATE Item SET Status =@stat FROM Item INNER JOIN Auction ON Item.ItemID = Auction.ItemID Where Auction.Auction = @auction"
                Dim mycomand = New SqlCommand(sql3, conss)
                mycomand.Parameters.AddWithValue("@auction", auctionid)
                mycomand.Parameters.AddWithValue("@stat", "Auctionned")
                mycomand.ExecuteNonQuery()
    
                Dim sql4 As String = "Update Auction Set Status =@status where AuctionID =@auction"
                Dim mycommand = New SqlCommand(sql4, conss)
                Dim status As String = "Not Valid"
                mycommand.Parameters.AddWithValue("@status", status)
                mycommand.Parameters.AddWithValue("@auction", auctionid)
                mycommand.ExecuteNonQuery()
            End Using
    
        End Sub

    WHAT IS THE PROBLEM PLEASE??

    Thursday, January 16, 2014 12:59 PM

Answers

All replies