By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,677 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,677 IT Pros & Developers. It's quick & easy.

Open a file save as byte

P: n/a
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.
Nov 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
' Convert the byte array to a string

Dim ascii As ASCIIEncoding = new ASCIIEncoding();

Dim strText As String = ascii.GetString(myDoc);

"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.

Nov 20 '05 #2

P: n/a
Do you know the type of data in your byte array or the original file name ?

if so you could just write your byte array out to a temp file and then use
Process.Start(tempfilename) so long as it has the correct extension and it
is mapped in windows.
"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.

Nov 20 '05 #3

P: n/a
* "Nicolas" <nl*****@hotmail.com> scripsit:
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.


You will have to save it to disk using 'System.IO.FileStream' and then
use 'System.Diagnostics.Process.Start' to open the file.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

P: n/a
So I should Save the Type of the file within the database right.
and then how do you go to create the file (byte array out to a temp file)
because i don't know if it is a text or graphic or media file

Thank again
"Greg Young" <gr********@planetbeach.com> wrote in message
news:uw**************@TK2MSFTNGP11.phx.gbl...
Do you know the type of data in your byte array or the original file name ?
if so you could just write your byte array out to a temp file and then use
Process.Start(tempfilename) so long as it has the correct extension and it
is mapped in windows.
"Nicolas" <nl*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
How do I open a file which is saves into the database as byte()

So far, I got this and it's working

Dim myDoc as Byte()
myDoc = CType(dbDataRow("Document"), Byte())

From there how do I open this so the user can review this file.

Thank for the help.


Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.