Results 1 to 3 of 3

Thread: streaming a database binary file into a textbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    73

    streaming a database binary file into a textbox

    I have a field that is storing a text file in my database after it was converted to binary. My question is how do you read that binary file from the database, convert it back to text, and then apply it to textbox1.text? Of course, I already checked http://msdn.microsoft.com/en-us/libr...orystream.aspx , but I still can't figure out, on my own, how to accomplish this.

  2. #2
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: streaming a database binary file into a textbox


  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: streaming a database binary file into a textbox

    There's no need for a MemoryStream. Get the data from the database just as you would any other data. It will be returned as a Byte array. You can then use the Encoding.GetString method to convert that to a String, just as you'd use GetBytes to go the other way.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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