это я сделал, чтобы решить вышеуказанный вопрос, чтобы решить
website1.aspx
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" OnTick="UpdateTimer_Tick" Interval="5000">
</asp:Timer>
<Triggers>
<asp:AsyncPostBackTrigger controlid="Timer1" eventname="Tick" />
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" PageSize="1"
EnableModelValidation="True" AutoGenerateColumns="False">
<PagerSettings Visible="False" />
<columns>
<asp:ImageField DataImageUrlField="Image" >
<ControlStyle Height="500px" Width="860px" />
</asp:ImageField>
</columns>
</asp:GridView>
<br />
</Triggers>
</ContentTemplate>
</asp:UpdatePanel>
website1.aspx.cs
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
LoadData();
}
protected void UpdateTimer_Tick(object sender, EventArgs e)
{
int pagecount = GridView1.PageCount;
int pageIndex = GridView1.PageIndex;
if (pageIndex != pagecount)
{
GridView1.PageIndex = pageIndex + 1;
LoadData();
Label1.Text = "" + GridView1.PageIndex++;
}
if (pageIndex == pagecount-1)
{
pageIndex = pageIndex - pagecount;
GridView1.PageIndex = pageIndex + 1;
LoadData();
Label1.Text = "" + GridView1.PageIndex++;
}
}
private void LoadData()
{
using (SqlConnection connection = new SqlConnection("Data Source=CJ-PC\\SQLEXPRESS;Initial Catalog=Online_Interaction;Integrated Security=True"))
{
using (SqlCommand command = new SqlCommand("Select [Image] from Picture_album", connection))
{
using (SqlDataAdapter da = new SqlDataAdapter(command))
{
DataTable dt = new DataTable();
da.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
Спасибо за помощь stackoverflow