.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Melody Anderson

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Images slideshow directly from the database( does not from save any folder).

Posted By: kavitha     Posted Date: November 18, 2010    Points:2   Category :ASP.Net
hi friends,

i want to only images slideshow directly from the database( does not from save any folder).

it is possible.

thanks .

Follow the following code:

Database Scripts

ImageName VARCHAR(50),
ImageTitle VARCHAR(50),
ImageDescription VARCHAR(50))

INSERT INTO TblImages VALUES('Winter.jpg','Winter','Description of Winter')
INSERT INTO TblImages VALUES('Sunset.jpg','Sunset','Description of Sunset')


<head runat="server">
<title>Untitled Page</title>

<script runat="Server" type="text/C#">
public static AjaxControlToolkit.Slide[] GetSlides()
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[2];
System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection("server=.;integrated security=true;database=dotnetspider");
System.Data.SqlClient.SqlDataAdapter sqlda = new System.Data.SqlClient.SqlDataAdapter("select * from TblImages", con);
System.Data.DataTable dt = new System.Data.DataTable();
for (int i = 0; i <= dt.Rows.Count - 1; i++)
slides[i] = new AjaxControlToolkit.Slide("Images/" + dt.Rows[i]["ImageName"].ToString(), dt.Rows[i]["ImageTitle"].ToString(), dt.Rows[i]["ImageDescription"].ToString());
return (slides);

<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<asp:Label ID="LblID" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="LblDescription" runat="server" Text="Label"></asp:Label><br />
<asp:Image ID="Image1" runat="server" Height="114px" Width="133px" /><br />
<asp:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="Image1"
SlideShowServiceMethod="GetSlides" AutoPlay="true" ImageTitleLabelID="LblID"
ImageDescriptionLabelID="LblDescription" NextButtonID="BtnNext" PlayButtonText="Play"
StopButtonText="Stop" PreviousButtonID="BtnPrevious" PlayButtonID="BtnPlay" Loop="true">
<asp:Button ID="BtnPrevious" runat="server" Text="Button" />
<asp:Button ID="BtnPlay" runat="server" Text="Button" />
<asp:Button ID="BtnNext" runat="server" Text="Button" />


No response found. Be the first to respond this post
Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend