locked
sql byte array RRS feed

  • Question

  • I have a byte array of a file and I need to save it into my database in a field that has been set aside of type image.

     

    However I have a problem my data access class takes a sql string and commits it to the database for example.

     

    "EXECUTE stored proc @parm1, @parm2, @parm3"

     

    However the problem is I cannot figure out how to transfer the byte array to string so that I can add it as an argument.

     

    I hope this make sense.

     

    I also understand that I can build parameters in com objects but I do not want to do this as it will disrupt my whole data access class and I am not prepared to do this at the moment.

     

    Thanks for any help.

     

    Friday, August 28, 2009 11:01 AM

Answers

  • Hello,
    Not sure what it is that you are asking here, but it sounds like you are having problems fitting multiple items into a container designed for just a single item.

    But, if you wish to store the byte array as a string, then you will need to iterate the array, and build a string representation by concatenating each byte.ToString onto the end of the string representation.  Good luck "un-stringing" the data.  Sounds like a rather time consuming headache in each direction.


    Hope this helps.

    Rudedog  =8^D

    Mark the best replies as answers. "Fooling computers since 1971."
    Friday, August 28, 2009 4:55 PM