ASP.NET - How to make automatic browsing to images from database ?

Asked By ahmed elbarbary on 28-Apr-17 11:37 AM

I work in MVC 5 c# in visual studio 2015 web applications

I have table pictures in SQL server 2012 have two fields



ID have number of image inserted like 1,2,3,4,5

Image field store picture added

what i need actually browsing images found in table pictures in database from last image inserted to first in page

and browsing between every image and another 1 second automatically without using button or scroll

suppose i have 4 images in database in table pictures

after page open picture 4 display after 1 second picture 3 display after 1 second picture 2 display after 1 second picture 1 display .

How i do that please ?

Robbe Morris replied to ahmed elbarbary on 29-Apr-17 12:53 PM
Cast the dataTable["ImageColumn"] as a byte[] and then use Response.BinaryWrite(myByteArray)
ahmed elbarbary replied to Robbe Morris on 29-Apr-17 04:16 PM
thank you for reply
can you please give me answer by details if possible
im beginner in mvc
Robbe Morris replied to ahmed elbarbary on 29-Apr-17 04:29 PM
No.  I won't write your code for you.  The JavaScript function you are looking for to automatically cycle through function calls is window.setInterval.  Between this and the stuff I gave you for writing the image from the database, you should be able to find code samples via Google.