Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    2

    Unanswered: display image as hexadecimal string

    hello,
    I am a beginner in VS 2005
    I am using c# and sql server 2005 express
    I have to save images on database and then to get them
    the problem is that I am using string query
    so to put the image I've wrote it on hexadecimal format (I converted byte[] to hexadecimal)
    the problem is when I get back the image:

    Is it possible to display the image data on hexadecimal format??

    or can I create a function that converts image data to a text containing this hexadecimal conversion

    Thanks
    cordially.

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I dunno. Most experienced seasoned right minded senior developers store images in the filesystem and the location of the images in the database.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    That's a very blind statement, that completely dismisses any business and application intricacies. Besides, most of "seasoned right minded senior developers" that I know SOMETIMES store images in the file system, and sometimes in databases. In short, - it all depends, and the rule has many affecting factors
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  4. #4
    Join Date
    Aug 2008
    Posts
    2

    solved

    solved
    just wrote it to database using 0x
    then get it back

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Quote Originally Posted by rdjabarov
    That's a very blind statement, that completely dismisses any business and application intricacies. Besides, most of "seasoned right minded senior developers" that I know SOMETIMES store images in the file system, and sometimes in databases. In short, - it all depends, and the rule has many affecting factors
    in 2008 there's a 3rd way (well, really a hybrid of these two) with the new FILESTREAM attribute. using that, sql server stores the blob on the filesystem, but to clients it looks like a column in a table.

    you still get all the nice database things such as backups, concurrency, etc.

  6. #6
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Yup, in 2008 CTP in early '07 this feature was already available. But the OP is working with SQLExpress2K5 where this is not an option.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •