CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    2

    Wink How to Save CSV & Text File to Image Field in SQL table?

    Hi all,

    urgently need help on how to store CSV & Text file to an Image Field in SQl table.
    the table is using by some other application that's why i could not change the field data type.
    appreciate any suggestions.
    Thanks a lot.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to Save CSV & Text File to Image Field in SQL table?

    You can save a string (or an image) into one field, but the other program has to know about that field.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Apr 2011
    Posts
    2

    Red face Re: How to Save CSV & Text File to Image Field in SQL table?

    Hi,
    currently already have a program to grab data from this 'image' field and populate it as an email attachment.
    so what i need to do is to fill in the 'image' field with my Csv/Text file data so that the program able to create attachment with it.
    any ideas?

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to Save CSV & Text File to Image Field in SQL table?

    You can SERIALIZE the image data, and store in one field, and the text in the other field.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: How to Save CSV & Text File to Image Field in SQL table?

    The only way to store images ( or any file for that matter ) into a database would be to use a Binary Reader / Writer. What concerns me is what database is the OP using?

    If it is Access 2007 or 2010, then there is an Attachment feature that can be used to save any sort of file into.

  6. #6
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to Save CSV & Text File to Image Field in SQL table?

    Agreed on the binary reader/writer, this is what I use to store images in SQL Server. No reason it shouldn't work for any file type.

    Haven't used Access 2007+
    Always use [code][/code] tags when posting code.

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured