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

Home Posts Topics Members FAQ

SQL Server, MS Word and C#.

The DB is SQL Server. The Language is C# (2003 version)

I want to insert some word files into the database and also be able to retreive them.
This is what I want to know
1) What DataType should the fiel be in the DB.
2) How can I go about inserting and reading from this field?

--------------------------------
From: Usman Ahmad

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>kaSvaFDlZECidz8+NMgsHA==</Id>
Nov 16 '05 #1
3 1430
Usman,

You should probably use the image data type in SQL Server (since the
files will most likely be of variable length).

The representation of this field on the .NET side should be an array of
bytes (byte[]). You should be able to load your document into an array, and
just set the field appropriately.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Usman Ahmad via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The DB is SQL Server. The Language is C# (2003 version)

I want to insert some word files into the database and also be able to
retreive them.
This is what I want to know
1) What DataType should the fiel be in the DB.
2) How can I go about inserting and reading from this field?

--------------------------------
From: Usman Ahmad

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>kaSvaFDlZECidz8+NMgsHA==</Id>

Nov 16 '05 #2
Data type would be binary.

Here's a good example
http://www.akadia.com/services/dotne...rite_blob.html

Hope this helps,
--- Nick

"Usman Ahmad via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The DB is SQL Server. The Language is C# (2003 version)

I want to insert some word files into the database and also be able to retreive them. This is what I want to know
1) What DataType should the fiel be in the DB.
2) How can I go about inserting and reading from this field?

--------------------------------
From: Usman Ahmad

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>kaSvaFDlZECidz8+NMgsHA==</Id>

Nov 16 '05 #3
brain freeze... Data type would be "image"
sorry about that.

"Nick Malik" <ni*******@hotmail.nospam.com> wrote in message
news:4IdZc.216372$8_6.69559@attbi_s04...
Data type would be binary.

Here's a good example
http://www.akadia.com/services/dotne...rite_blob.html

Hope this helps,
--- Nick

"Usman Ahmad via .NET 247" <an*******@dotnet247.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The DB is SQL Server. The Language is C# (2003 version)

I want to insert some word files into the database and also be able to

retreive them.
This is what I want to know
1) What DataType should the fiel be in the DB.
2) How can I go about inserting and reading from this field?

--------------------------------
From: Usman Ahmad

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>kaSvaFDlZECidz8+NMgsHA==</Id>


Nov 16 '05 #4

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

Similar topics

7
by: Tom | last post by:
Can anyone give me any advice on how to secure a folder on a network server so that documents in the folder can only be opened through an Access database or by the database admin. I need to store...
4
by: Kash | last post by:
Hi everybody: I've developed a web application running on a 2003 server not on the web but on extranet environment of a small Firm (less than 10 users). I've taken benefit of Office Primary...
2
by: tamaker | last post by:
I have a registration form where a user is able to, upon submission of the form, have their submission entered into a simple database... now Im looking to create a word document on the fly from...
1
by: tamasumalta | last post by:
I am using the attached code Private Sub StartApplicationProcess InitialiseObject() oWord.Visible = True oDoc = oWord.Documents.Open(StrStackPath) oWord.Visible = True end sub The...
20
MMcCarthy
by: MMcCarthy | last post by:
This problem was proposed to me but not really my area of expertise so I thought I would open it up to the forum to see if anyone had any bright ideas. The problem is generating Microsoft Word...
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...
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
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
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,...
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: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.