473,473 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Store files in the database?


How do I store files in a database? I have done something similar before in
a none microsoft language in a previous lifetime, byt breaking it down into
chunks and storing it in a BLOB field. Is this the same in SQL?

I have an app written for windows in C# with SQL 2000 on the back. I have a
print engine which users XML documents as the print document template, and
was hoping I could store these in the database, rather than shipping actual
documents out with the app. The idea being I retrieve the docs at runtime
from the db, rebuild them on the client, then print them off.

Any ideas ?

Thanks

Ste
Sep 2 '05 #1
3 1618
Steve,

Just see the samples from an image for that, it is even better if you first
Zip them.

Check our website and search for image. Although all our samples are made
for VB.Net

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor
Sep 2 '05 #2
I've managed to get the document into the db, I cant work out though how to
write it back out to disk. In your example you have a Bitmap object, is
there and equivalant object for a document? How do I specify where to write
the object to ?

"Cor Ligthert [MVP]" wrote:
Steve,

Just see the samples from an image for that, it is even better if you first
Zip them.

Check our website and search for image. Although all our samples are made
for VB.Net

http://www.windowsformsdatagridhelp.com/default.aspx

I hope this helps,

Cor

Sep 2 '05 #3
Steve,

It is the same, you read the file, store it in as a bitmap using the
memorystream and than you can get it again as a file as well using the
memorystream. The way you handles the data is of course the same as you
would handle the normal file. A textfile you would normaly handle as a
string by instance, however a doc would need interop.

I hope this helps,

Cor
Sep 2 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: cover | last post by:
The question is, we have two options to store images, either in a Database (MySQL, Postgres, ...) like blob data, or in the hard disk the file and the path in database. Which option is better?...
4
by: Benny Ng | last post by:
Hi, I have written a program in vb6 that can send and receive emails but how can i store them? Benny
5
by: Guadala Harry | last post by:
What are my options for *securely* storing/retrieving the ID and password used by an ASP.NET application for accessing a SQL Server (using SQL Server authentication)? Please note that this ID and...
2
by: Tim Zych | last post by:
How would I go about storing data files on my web host? I have an Access database driven website and I would like to save files and be able to download them. Can somebody point me in the right...
21
by: matvdl | last post by:
I have a system that was originally developed in asp - the pages are saved in SQL (there are over 10,000 pages) and saved to a temp directory in the server when requested by a client. I have...
3
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String...
2
by: wschanks | last post by:
I have an .adp (Access 2003) file and I need to store files in a field on the database. I have figured out that I need the data type to be 'Image', so I have my table with the this datatype. ...
8
by: romayankin | last post by:
I'm making some kind of news-board site on PHP (tthat's why I guess it's the right place to post the question here). Each entry would have a small picture (less then 100kb). Taking into...
4
by: vunet.us | last post by:
I want to know if this practice is effective and secure: I have been thinking about storing some data, which my users upload, in text files rather than database, since often I do not know how much...
4
by: lyealain | last post by:
how to store many files in one database fields?? i manage to store one file into database field.. but fail to store many files..... how should i do that>> one database field for many files name.....
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.