how to add images dynamically to adrotator using database in

Diksha dudi 126 Reputation points

i want to add images from table mainindex_img dynamically to adrotator.

here at the top after the header


A set of technologies in the .NET Framework for building web applications and XML web services.
3,414 questions
{count} votes

Accepted answer
  1. Lan Huang-MSFT 28,841 Reputation points Microsoft Vendor

    Hi @Diksha dudi ,
    Can you describe your needs in more detail? What does each data in the database mean?
    I guess you might want to use AdRotator with a database, you can refer to the code below.

      <asp:AdRotator id="AdRotator1" runat="server"/>  

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
            Using con As SqlConnection = New SqlConnection("****")     
                Using cmd As SqlCommand = New SqlCommand("SELECT * FROM mainindex_img", con)  
                    Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)  
                    Dim dt As DataTable = New DataTable()  
                    AdRotator1.DataSource = dt  
                End Using  
            End Using  
        End Sub  

    Best regards,
    Lan Huang

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful