Click here to Skip to main content
14,241,108 members
Rate this:
Please Sign up or sign in to vote.
i want to create a user profile page just like facebook, in which I want when the user login,user can upload his profile picture.

What I have tried:

i tried this but it is not working.
Storing Images in SQL Server using EF and ASP.NET[^]
Updated 13-Sep-17 13:55pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Images are stored as byte arrays in database blob fields. So here is a Google Search with Code first & DB first (not knowing which EF approach you are using) solutions: working with blobs in entity framework - Google Search[^]. One of these should suit your requirements.

Update: here is a two-part video tutorial of ASP.NET uploading, Saving, and loading Images to/from DB (from above Google Search):
* part 1 - Save image to database using asp net - YouTube[^]
* Part 2 - Load image from database in asp net - YouTube[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100