Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2004, 06:28 AM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default converting binary data

Hi
need help.
I have a sql server database storing files such as MS Word documents as binary data.
I would like to now go through the database and get the binary data using vb.net and convert the data in to the approriate file (e.g word document) and save it on the server
any advise? or scripts?

a


A
 
Old October 1st, 2004, 06:45 AM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have had some success (but look forward to any further advise suggestions.):

        Dim drGetBinaryExampleFile As SqlDataReader
        drGetBinaryExampleFile = ExecuteReader(...)
        If drGetBinaryExampleFile.Read() Then
            Try
                Dim fs As New FileStream("c:\\IntranetDocument\file.doc", FileMode.Create, FileAccess.Write)
                Dim stw As New BinaryWriter(fs)
                stw.Write(drGetBinaryExampleFile.Item("binFile"))

                stw.Close()
                fs.Close()
                Response.Write("Succes in writing a file")
            Catch ex As Exception
                Response.Write("<li>error")
                Response.Write(ex.ToString)
            End Try


A





Similar Threads
Thread Thread Starter Forum Replies Last Post
Binary Data zaghmout ASP.NET 2.0 Basics 0 November 15th, 2007 06:24 AM
Converting JPEG images into binary Bassaam .NET Framework 2.0 5 August 1st, 2006 02:38 PM
Converting an ASCII character to binary? skyraider Visual Basic 2005 Basics 0 May 7th, 2006 08:20 PM
Converting from binary to xml Morrislgn Pro VB.NET 2002/2003 0 February 2nd, 2006 12:46 PM
Binary Data in XML owain XML 1 November 11th, 2003 11:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.