Display picture slide show

Jan 14 2016 12:19 PM
I want to be able to display a picture slide show on my page, together with labeling and text, sliding together in sync.  Below is what I already have but it is not synchronizing. I will appreciate any help of the gurus.
 
 
private void GetImage()
{
SqlConnection conn = new SqlConnection("data source=.\\MSSQLSERVER2; initial catalog=SuperStoreDB; integrated security=true");
SqlCommand comm = new SqlCommand();
conn.Open();
comm.Connection = conn;
comm.CommandText = "SELECT TOP 1 Id,Name from Images order by NEWSEQUENTIALID ()";
SqlDataAdapter da = new SqlDataAdapter(comm);
DataTable dt = new DataTable();
da.Fill(dt);
//comm = new SqlCommand("Select * from Images");
SqlDataReader dr = comm.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
lblName.Text = dr["Name"].ToString();
Image1.ImageUrl = "~/HandlerImage.ashx?Id=" + dt.Rows[0][0];
}
conn.Close();
}
 
for the .ashx
public class HandlerImage : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
if (context.Request.QueryString["id"] != null)
{
// context.Response.Write(context.Request.QueryString["id"]);
SqlConnection conn = new SqlConnection("data source=.\\MSSQLSERVER2; initial catalog=SuperStoreDB; integrated security=true");
conn.Open();
SqlCommand comm = new SqlCommand("Select Image from Images where Id=@Id", conn);
comm.Parameters.AddWithValue("@Id", context.Request.QueryString["id"].ToString());
SqlDataReader dr = comm.ExecuteReader();
dr.Read();
context.Response.BinaryWrite((byte[])dr["Image"]);
dr.Close();
conn.Close();
}
else
{
context.Response.Write("No Image Found");
}
}

Thanks.

Answers (1)