I upload pictures to the default upload folder at web root. But when I see the contents - I only see image files by the name 0. like 0.Lg.jpg, 0.Md.jpg, 0.Sm.jpg. Then when I upload another image, it would overwrite existing 0 files. So in other words
I see only 0 files.. just 3 files.
When I debug this issue, found that in photo.cs file, the db.insertphoto always returns photoid= 0. This is coming from the dataadapter. When I run the method manually from the ads.xsd, it returns the correct photoid. The stored procedure also returns correct
value. For some reasons, Line 13 always returns 0.
Member
6 Points
214 Posts
Odd issue with Inserting photos
Feb 10, 2009 10:03 PM|nimish|LINK
I upload pictures to the default upload folder at web root. But when I see the contents - I only see image files by the name 0. like 0.Lg.jpg, 0.Md.jpg, 0.Sm.jpg. Then when I upload another image, it would overwrite existing 0 files. So in other words I see only 0 files.. just 3 files.
When I debug this issue, found that in photo.cs file, the db.insertphoto always returns photoid= 0. This is coming from the dataadapter. When I run the method manually from the ads.xsd, it returns the correct photoid. The stored procedure also returns correct value. For some reasons, Line 13 always returns 0.
Can anyone help?
Participant
1165 Points
1035 Posts
Re: Odd issue with Inserting photos
Feb 12, 2009 11:49 PM|darkknight187|LINK
The problem is that you are using the beta version of the classifieds kit instead of the final version.
The problem lies in your stored procedure InsertPhoto
Not the public static you have above.
Open the InsertPhoto Stored Procedure and I forget what it says in your version.
But the issue is at the end of it.
Try this:
SELECT @Id AS [Id]
If it doesn't work paste your stored procedure.
Good Luck
- Daniel
Please remember to mark the post as answer that solves your issue.
This will be greatly benificial for other users.
Member
6 Points
214 Posts
Re: Odd issue with Inserting photos
Feb 13, 2009 08:29 PM|nimish|LINK
I downloaded the kit from asp.net starter kit section. If I run the method in dataset, it returns correct value.
Below is SP my code-
Participant
1165 Points
1035 Posts
Re: Odd issue with Inserting photos
Feb 13, 2009 10:10 PM|darkknight187|LINK
Trust me.
I have been using the kit for a long time, it's the beta you have.
Something must of happened to Microsoft's version and they removed the final.
And then the only available download was beta.
Anyway, replace line 19 "Return @Id" with
SELECT @Id AS [Id]
It will work.
Please remember to mark the post as answer that solves your issue.
This will be greatly benificial for other users.
Member
6 Points
214 Posts
Re: Odd issue with Inserting photos
Feb 14, 2009 09:21 AM|nimish|LINK
Ok I will try that but now I am thinking maybe there are more issues that I am not aware.
Where can I get final or latest copy? Link can be helpful.
Thanks for your help, really appreciate it.
Participant
1165 Points
1035 Posts
Re: Odd issue with Inserting photos
Feb 14, 2009 10:17 AM|darkknight187|LINK
I don't think their is a link.
I still have the final class.vsi
Send me a private message with your email address, and I will send it to you.
Please remember to mark the post as answer that solves your issue.
This will be greatly benificial for other users.