add photo error

Last post 05-06-2008 2:38 PM by labrador_007. 5 replies.

Sort Posts:

  • add photo error

    02-18-2007, 3:37 PM
    • Loading...
    • Alhakimi
    • Joined on 09-16-2006, 9:59 PM
    • India
    • Posts 40

    hi all ;

    i am using jermey PSW , and  I am facing this error whenever i try to upload new picture to my website and its working fine in my local machine but not on the remote server ? 

    is it related to the permission of the albums folder or some thing else .  

    so i tried to change the albumid into the photoid this error stoped coming and "no photo"  picture comes inside the album .

    this is the error message  

    Procedure or Function 'RemovePhoto' expects parameter '@PhotoID', which was not supplied.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Procedure or Function 'RemovePhoto' expects parameter '@PhotoID', which was not supplied.

    Source Error:

    Line 221:                    command.Parameters.Add(New SqlParameter("@AlbumID", AlbumID))
    Line 222: connection.Open()
    Line 223: command.ExecuteNonQuery()
    Line 224: End Using
    Line 225: End Using


     Thank you

    Rashed 

  • Re: add photo error

    02-22-2007, 4:55 PM
    • Loading...
    • wlogarbo
    • Joined on 02-22-2007, 9:43 PM
    • Posts 1

    Hello Rashed,

    It looks like you are trying to pass in the albumid instead of the photoid.  Try changing this and it should work.  I stumbled across this problem by accident.  I didn't have the correct permissions to the folder I was writing to, so the app threw an exception and went to the catch block.  And in doing so, I found I was trying to pass in the wrong parameter when it was trying to remove the photo.

    Hope this helps.

     

    Wayne

  • Re: add photo error

    02-22-2007, 9:29 PM
    Answer
    • Loading...
    • jwadsworth
    • Joined on 03-13-2003, 4:16 PM
    • Salem, Oregon
    • Posts 540
    Alhakimi:

    hi all ;

    i am using jermey PSW , and  I am facing this error whenever i try to upload new picture to my website and its working fine in my local machine but not on the remote server ? 

    is it related to the permission of the albums folder or some thing else .  

    so i tried to change the albumid into the photoid this error stoped coming and "no photo"  picture comes inside the album .

    this is the error message  

    Procedure or Function 'RemovePhoto' expects parameter '@PhotoID', which was not supplied.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Procedure or Function 'RemovePhoto' expects parameter '@PhotoID', which was not supplied.

    Source Error:

    Line 221:                    command.Parameters.Add(New SqlParameter("@AlbumID", AlbumID))
    Line 222: connection.Open()
    Line 223: command.ExecuteNonQuery()
    Line 224: End Using
    Line 225: End Using


     Thank you

    Rashed 

    Rashed,

    The error you're receiving is actually a bug in my kit. That error occurs when:

    • you try to import a photo from the Upload folder to an album folder
    • A reference to the photo in the album is created in the database
    • Then the application attempts to copy the photo from the Upload folder to the chosen Album folder
    • The Network Services account doesn't have sufficient rights to copy the photos from the Upload folder to the Album folder you've chosen.
    • Because it fails to copy, the RemovePhoto procedure is called to remove the reference in the database to the photo since it didn't get copied correctly.
    • The error occurs because I have a bug in that procedure.

    So, the issue is insufficient rights on the Albums folder.

     

  • Re: add photo error

    02-23-2007, 12:15 PM
    • Loading...
    • Alhakimi
    • Joined on 09-16-2006, 9:59 PM
    • India
    • Posts 40

    Cool man thanx alot for ur help u r so greet ...

    It helps to understand the error i contacted the webhosting company and they made the right recuired and its working fine now

    thanx

  • Re: add photo error

    02-23-2007, 12:27 PM
    • Loading...
    • jwadsworth
    • Joined on 03-13-2003, 4:16 PM
    • Salem, Oregon
    • Posts 540
  • Re: add photo error

    05-06-2008, 2:38 PM

    Same problem - do not get any error message - it simply does not copy the images in the filesystem when I click on the import all button - The Exception is raised because the WritetoFile (FileStream) procedure fails to copy the image files. I have asked my web hosting company to grant me rights on the Albums folder - hopefully it will work.

    jwadsworth:
    Your welcome.

Page 1 of 1 (6 items)
Microsoft Communities
Page view counter