Link to home
Start Free TrialLog in
Avatar of bpsp10
bpsp10Flag for United Kingdom of Great Britain and Northern Ireland

asked on

How to upload a photo to MS SQL using C# ASP.NET

Hey guys,

I would like to use my C# application to store images.

I suppose the best way is to make it so the image gets moved to the \\Images folder for the application and then the Database stores the file path? Or would it be better to store the image in the database itself?

I have table RoomPhoto with fields:
RoomPhoto_ID
RoomPhoto_Photo
TenancyAgreement_ID (FK from TenancyAgreement table)

What is the best way to do this and how would I do it?

Thanks in advance
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image


its better to store the image outside the database and store the file path in the DB
ASKER CERTIFIED SOLUTION
Avatar of TomasP
TomasP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bpsp10

ASKER

Ok thanks for the advice..... now the hard bit....

How would I go about doing this? Any examples for code?

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.