Introduction: In this article i am going to share the code to upload the image through file upload control and save/store the image in binary form in Sql server database and then read/retrieve the record along with image and display in DataList data control in asp.net using both C# and VB languages.
How to upload image through asp.net fileupload control in folder?
How to store uploaded image in binary format in Sql server database?
How to read/retrieve the image stored in binary form from the sql server database and show in DataList data control?
I have created a demo web page from where i will insert book record like Book name, its author, publisher, price and Book picture. As soon as a new record will be inserted it will get binded to the Datalist control as show in the sample image shown above.
Implementation: Let's create a demo website page to insert data including image in database and retrieve that data and fill in datalist data controls.
Create a folder in the root directory of the project and name it "BookPictures". Uploaded Book images will be stored in this folder and the path will be saved into the database and this image will be converted to binary format and stored in database.
" I hope you have got the way to upload image in folder and store image path in database and retrieve the image path from sql server database and display in DataList using asp.net and If you like my work; you can appreciate by leaving your comments, hitting Facebook like button, following on Google+, Twitter, Linked in and Pinterest, stumbling my posts on stumble upon and subscribing for receiving free updates directly to your inbox . Stay tuned and stay connected for more technical updates."