locked
retrieving advt. information from database to the web pate in asp.net RRS feed

  • Question

  • User1584448589 posted

    HI, there

    I'm designing one web application in which i want to display advt. text, advt. banner as well it wil b comign from database only. the problem is im doing this for the first time so i want an idea how to do so . how can we change the advt. each time user refreshes the page?????? how to position them along with the search results? is there any  demo web site with which i can make my web site??

    just like the post page here as advt. is displayed jst give me some refernece to articles where i can get information on this problem....



    Thanks in advance!!!


    Thursday, September 3, 2009 4:13 AM

Answers

  • User312496708 posted

    have a look at the adrotator control

    http://www.codeproject.com/KB/webforms/AdRotator_VT.aspx

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.adrotator.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 5:11 AM
  • User-68639941 posted

    try by using asp.net AdRotator control

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 5:22 AM
  • User-1696077569 posted

     Follow below steps for Display Ads From a Database Using the AdRotator Web Server Control

    To create the database table for ads

    1. If you do not already have a database table that contains the ad information, create a table with the following schema. All columns except ID are optional.

      NoteNote

      Data types are provided as SQL Server types. If you are using a different database, substitute the appropriate corresponding type.

      <!---->
      Column name Data type Description

      ID

      int

      Primary key. This column can have any name.

      ImageUrl

      nvarchar(length)

      The relative or absolute URL of the image to display for the ad.

      NavigateUrl

      nvarchar(length)

      The target URL for the ad. If you do not provide a value, the ad is not a hyperlink.

      AlternateText

      nvarchar(length)

      The text displayed if the image cannot be found. In some browsers, the text is displayed as a ToolTip. Alternate text is also used for accessibility so that users who cannot see the graphic can hear its description read out loud.

      Keyword

      nvarchar(length)

      A category for the ad on which the page can filter.

      Impressions

      int(4)

      A number that indicates the likelihood of how often the ad is displayed. The larger the number, the more often the ad will be displayed. The total of all impressions values in the XML file may not exceed 2,048,000,000 - 1.

      Width

      int(4)

      The width of the image in pixels.

      Height

      int(4)

      The height of the image in pixels.

    2. If you have an existing database table with ad information in it, set the following properties of the AdRotator control to map your database table schema to the fields required by the control:

    3. Insert new records into the table with ad information.

    To display ads from the database

    1. Place a data source control, such as a SqlDataSource or AccessDataSource control, onto the page.

    2. Configure the data source control with a connection string and query to select all of the records from the database table you created earlier.

      NoteNote

      For information about using data source controls, see Data Source Web Server Controls.

    3. Place an AdRotator control on the ASP.NET Web page where you want the ads to appear.

    4. Set the AdRotator control's DataSourceID property to the ID of the data source control that you created earlier in step 1.

      When the page runs, the AdRotator control will query the database for the ads and select one to display.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 5:30 AM

All replies

  • User312496708 posted

    have a look at the adrotator control

    http://www.codeproject.com/KB/webforms/AdRotator_VT.aspx

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.adrotator.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 5:11 AM
  • User-68639941 posted

    try by using asp.net AdRotator control

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 5:22 AM
  • User-1696077569 posted

     Follow below steps for Display Ads From a Database Using the AdRotator Web Server Control

    To create the database table for ads

    1. If you do not already have a database table that contains the ad information, create a table with the following schema. All columns except ID are optional.

      NoteNote

      Data types are provided as SQL Server types. If you are using a different database, substitute the appropriate corresponding type.

      <!---->
      Column name Data type Description

      ID

      int

      Primary key. This column can have any name.

      ImageUrl

      nvarchar(length)

      The relative or absolute URL of the image to display for the ad.

      NavigateUrl

      nvarchar(length)

      The target URL for the ad. If you do not provide a value, the ad is not a hyperlink.

      AlternateText

      nvarchar(length)

      The text displayed if the image cannot be found. In some browsers, the text is displayed as a ToolTip. Alternate text is also used for accessibility so that users who cannot see the graphic can hear its description read out loud.

      Keyword

      nvarchar(length)

      A category for the ad on which the page can filter.

      Impressions

      int(4)

      A number that indicates the likelihood of how often the ad is displayed. The larger the number, the more often the ad will be displayed. The total of all impressions values in the XML file may not exceed 2,048,000,000 - 1.

      Width

      int(4)

      The width of the image in pixels.

      Height

      int(4)

      The height of the image in pixels.

    2. If you have an existing database table with ad information in it, set the following properties of the AdRotator control to map your database table schema to the fields required by the control:

    3. Insert new records into the table with ad information.

    To display ads from the database

    1. Place a data source control, such as a SqlDataSource or AccessDataSource control, onto the page.

    2. Configure the data source control with a connection string and query to select all of the records from the database table you created earlier.

      NoteNote

      For information about using data source controls, see Data Source Web Server Controls.

    3. Place an AdRotator control on the ASP.NET Web page where you want the ads to appear.

    4. Set the AdRotator control's DataSourceID property to the ID of the data source control that you created earlier in step 1.

      When the page runs, the AdRotator control will query the database for the ads and select one to display.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 3, 2009 5:30 AM