473,387 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

unable to take data from database and place into a file

123 100+
I'm trying to take attachments that were saved on a database and place them on a harddrive. However, I can create the file, however when I open the file I get system.Byte[] or image cannont be viewed on the files.

Here is the code I am using:

public void saveattachment(String MKS_attachmentName, Byte[] MKS_attachmentContent)
{

StreamWriter sw = new StreamWriter("C:/MKSattachments/" + MKS_attachmentName);

sw.Write(MKS_attachmentContent);

sw.Close();

}

I stream the attachment Name into the file name and the write the contents of the file using the .write() method. The MKS_attachmentContent is in the type Byte[], which I'm currently unfimiliar with.

Any help I would be grateful for.

Thank you in advance,

Newbie19
Jan 8 '08 #1
5 1207
weaknessforcats
9,208 Expert Mod 8TB
This appears to be Java. I am moving this to the Java forum.
Jan 8 '08 #2
BigDaddyLH
1,216 Expert 1GB
This appears to be Java. I am moving this to the Java forum.
In what package is StreamWriter defined?
Jan 8 '08 #3
Newbie19
123 100+
This appears to be Java. I am moving this to the Java forum.

Its not Java, its C#
Jan 8 '08 #4
BigDaddyLH
1,216 Expert 1GB
Its not Java, its C#
I feel so dirty! At least 20 characters of dirty.
Jan 8 '08 #5
Newbie19
123 100+
[quote=BigDaddyLH]I feel so dirty! At least 20 characters of dirty.[/QU

ha, yeah Microsoft's rip off of Java.
Jan 8 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Wayno | last post by:
Hoping someone can help me out with this problem. First problem, is I am unable to view my php error log. In my php.ini I have my log in /var/www/logs/php_error_log. However, it has remained empty....
2
by: mar10 | last post by:
I've been working on a database with several tables that I've established relationships for. I needed to add some fields to one of the tables and before I did anything to my current table I...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
2
by: phil | last post by:
Hi, I use aspnet 2.0 and i'm learning about data-bound controls. Sometimes, i get this error below, but the code of the aspx page is ok because i ran it several times. I use indeed a .mdf file...
6
by: tshad | last post by:
I had asked about this before, but have been unable to solve the problem. Could this be a problem with Web Services? I have 4 web services that I reference in this object. There is only one...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
3
by: weird0 | last post by:
This is the exception that I get when i create a webserivce obj and call. The error comes on the webmethod call, when it opens a connection to the db. How do I fix it? What is the solution to...
1
by: believeinblue44 | last post by:
I have recently spent countless hours building, tweaking, and perfecting numerous forms and they all are working fine now and i'm nearly done...now all i have to do is put them as Web Data Pages, put...
0
by: believeinblue44 | last post by:
Sorry for the double post but i recieved no responses earlier and am running short on ideas. I have recently spent countless hours building, tweaking, and perfecting numerous forms and they all...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.