Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to retrieve image from database into a adrotator

how to retrieve image from database into a adrotator

Scheduled Pinned Locked Moved ASP.NET
databasecsharphelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ships_agr
    wrote on last edited by
    #1

    i've stored an image in binary format in database using ADO.net and i want to display the image in adrotator or into an image type control..but i don't know which function to use; i connected the adrotator to sqldatasource through a configure datasource wizard and when i tested the query there in wizard it worked f9...but on running the application no image is displayed in adrotator.....CAN ANYONE HELP ME...??

    S 1 Reply Last reply
    0
    • S ships_agr

      i've stored an image in binary format in database using ADO.net and i want to display the image in adrotator or into an image type control..but i don't know which function to use; i connected the adrotator to sqldatasource through a configure datasource wizard and when i tested the query there in wizard it worked f9...but on running the application no image is displayed in adrotator.....CAN ANYONE HELP ME...??

      S Offline
      S Offline
      sashidhar
      wrote on last edited by
      #2

      Here is the sample code to show in page from database which i used earlier..!

      byte[] arrContent = null;
      DataTable dt = new DataTable();
      DataRow dr = default(DataRow);
      int id = Convert.ToInt32(Request.QueryString["id"]);
      //string username=Page.User.Identity.Name;
      //Getting the Image
      dt = PlayerInfo.ImagSelect(username);
      dr = dt.Rows[0];
      //storing it in array
      arrContent = (byte[])dr["photo"];
      int length = arrContent.Length;
      Response.ContentType = "image/JPEG";
      if (length!=0)
      Response.OutputStream.Write(arrContent, 0,length);
      Response.End();

      You can check this link to sample Image Control..!

      ships_agr wrote:

      i connected the adrotator to sqldatasource through a configure datasource wizard and when i tested the query there in wizard it worked f9...but on running the application no image is displayed in adrotator

      It Should be converted to binary format .You can visible the image thr wizard but not in page..!

      LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups