Hi I have made a website where it is possible to see the days program on one page, it updates itself so it is only for that day.
But now I wan't to be able to insert a picture that changes position according to what time it is.
For example if the time is 1pm. then the small picture should move down to 1pm.
and if the time is 3pm the picture moves down to 3pm.
Maybe you can see what I meen on:
http://radio.web.surftown.dk/default.aspx
the time is written as datetime in my ms sql database.
my code on my aspx page looks like this:
<%# Eval("tid", "{0:t}")%>
and my code on the codebehind page looks like this:
SqlConnection objconn = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionstring"].ToString());
SqlCommand objcmd = new SqlCommand();
objcmd.Connection = objconn;
objcmd.CommandType = CommandType.Text;
if (DateTime.Now.Hour > 3)
{
objcmd.CommandText = "SELECT * FROM PROGRAM WHERE CONVERT(VARCHAR, date, 105) = CONVERT(VARCHAR, GETDATE(), 105)";
SqlDataReader reader = null;
objconn.Open();
reader = objcmd.ExecuteReader();
program.DataSource = reader;
program.DataBind();
objconn.Close();
}
else
{
objcmd.CommandText = "SELECT * FROM PROGRAM WHERE DATE = DATEADD(day, DATEDIFF(day, 1, GETDATE()), 0)";
SqlDataReader reader = null;
objconn.Open();
reader = objcmd.ExecuteReader();
program.DataSource = reader;
program.DataBind();
}
}
I hope you understand what I meen and that you can help me?