the database that i created only
imageName - varchar
imageUP - image type
can all the talent show me how to do, can show the the data type also (database)..
I USING VB2008, ASP.NET C#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Roei BarRank #1,271 · 1.4K reputationPosted Aug 14, 2009, 10:53 PM EDT
private DataTable FetchAdsFromDB() { string sql = "select * from YourAdRotatorTableName"; SqlDataAdapter da = new SqlDataAdapter(sql, ); DataTable dt = new DataTable(); da.Fill(dt); return dt; }and the addrotator Timer event
good luck, and if you like it, dont forget to"mark as accepted answer"
Master BillaRank #2,229 · 630 reputationPosted Aug 14, 2009, 11:22 PM EDT
Add adrotator in your html code and write code like this way with timer tick to display image in interval
just simple code snippet here
private DataTable GetImages()
{
string sql = "select * from YourAdRotatorTableName";
SqlDataAdapter da = new SqlDataAdapter(sql, con);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
protected void Timer1_Tick(object sender, EventArgs e)
{
AdRotator1.DataSource = GetImages();
AdRotator1.DataBind();
}
and more details here
http://www.aspdotnetcodes.com/Asp.Net_AdRotator_Database.aspx
thank you
Gai Ben Ben3 reputationPosted Aug 14, 2009, 11:37 PM EDT
First, i must thank you..
but i can't run it, because this error appear "The control with ID 'Timer1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it." .
is it like this??
private DataTable FetchAdsFromDB()
{
string sql = "select * from the database i 1 retrieve";
SqlDataAdapter da = new SqlDataAdapter(sql, db connection);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
no need create any database connection..
and what if my database contain many many pictures, and i 1 to let user to choose the picture that he already UpLoad??