protected void BindDataList() { con.Open(); //Query to get ImagesName and Description from database SqlCommand command = new SqlCommand("SELECT TOP 5 * FROM [SlideShowTable1] where (startddate <= @sdate) AND (endddate >=@edate) AND AddType=@Add ORDER BY ImageID() ", con); command.Parameters.AddWithValue("@sdate", System.DateTime.Now.ToString("M/d/yyyy")); command.Parameters.AddWithValue("@edate", System.DateTime.Now.ToString("M/d/yyyy")); command.Parameters.AddWithValue("@Add", "Right_Side_Add"); SqlDataAdapter da = new SqlDataAdapter(command); DataSet dt = new DataSet(); da.Fill(dt); dllImages.DataSource = dt; dllImages.DataBind(); con.Close(); }
SqlCommand command = new SqlCommand("SELECT TOP 5 * FROM [SlideShowTable1] where (startddate <= @sdate) AND (endddate >=@edate) AND AddType=@Add ORDER BY newid() ", con);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)