how to store binary data to MediumBlob Field (VB.net and MysqldriveCS)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: how to store binary data to MediumBlob Field (VB.net and MysqldriveCS)

  1. #1
    Join Date
    Jun 2007
    Posts
    113

    how to store binary data to MediumBlob Field (VB.net and MysqldriveCS)

    i need to store the a filestream to a mediumblob field the problem its that i cant concatenate Filestream type with string

    the bellow line shows how i usually make the insert command but itsnt working here cuz filestream object cant be concatenated with string

    sql.CommandText = "insert into " & "CBicom" & " values('" & Name & "','" & Value & "');"

    Value its the filestream object

    so my question its how to make the "insert command" to store the file stream on the field

    thx in advance
    Last edited by Alphadan; 07-29-2007 at 08:37 AM.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    You must read the FileStream into a byte array and then save the bytes to the database: http://support.microsoft.com/kb/317016/
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Jun 2007
    Posts
    113
    thx phil, for the tip and the link it solved my problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center