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. General Programming
  3. C#
  4. error while retriving an image from Firebied database

error while retriving an image from Firebied database

Scheduled Pinned Locked Moved C#
databasehelpcsharpandroidgraphics
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.
  • A Offline
    A Offline
    avvaru murali
    wrote on last edited by
    #1

    Hi iam in windows application in c# my database is "Firebird Database"; iam saving an picture into database.but iam unable to retrive same picture from database mycode is : This code is in DataAccess layer. string query = "select photo from cust1 where id=" + id; FbDataAdapter adb = new FbDataAdapter(query, cnn); DataSet ds = new DataSet(); adb.Fill(ds, "cust1"); if (ds.Tables[0].Rows.Count > 0) { DataRow dr; dr = ds.Tables[0].Rows[0]; if (!dr["photo"].Equals(DBNull.Value)) { byte[] content = (byte[])dr["photo"]; MemoryStream stream = new MemoryStream(content); photo = stream; } } Bitmap img = new Bitmap(objcls.photo);---------------"ERROR" pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox1.Image = img; it is giving error "parameter is not valid" please inform where the exact problem is

    murali krishna

    C 1 Reply Last reply
    0
    • A avvaru murali

      Hi iam in windows application in c# my database is "Firebird Database"; iam saving an picture into database.but iam unable to retrive same picture from database mycode is : This code is in DataAccess layer. string query = "select photo from cust1 where id=" + id; FbDataAdapter adb = new FbDataAdapter(query, cnn); DataSet ds = new DataSet(); adb.Fill(ds, "cust1"); if (ds.Tables[0].Rows.Count > 0) { DataRow dr; dr = ds.Tables[0].Rows[0]; if (!dr["photo"].Equals(DBNull.Value)) { byte[] content = (byte[])dr["photo"]; MemoryStream stream = new MemoryStream(content); photo = stream; } } Bitmap img = new Bitmap(objcls.photo);---------------"ERROR" pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox1.Image = img; it is giving error "parameter is not valid" please inform where the exact problem is

      murali krishna

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      avvaru.murali wrote:

      please inform where the exact problem is

      We can't tell you the "exact" anything unless you explain your problem better. You need to give us more information: What is photo? What is the error?

      Upcoming FREE developer events: * Developer Day Scotland Recent blog posts: * Different ways to add point data in SQL Server 2008 * Spatial References in SQL Server 2008 My website |

      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