473,513 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ 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 1621
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
3663
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
3903
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
4490
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
3181
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
2908
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
2844
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
2317
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
1649
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
6925
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
1935
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
7157
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
7535
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...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5682
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
5084
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
4745
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
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
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 ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.