473,785 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Opening word documents stored in SQL Server using ASP.Net

Hello, i'm hoping that somebody can point me in the right direction with my
problem.

I have been tasked with creating a simple browser based application that
will allow the user to upload Word documents to SQL Server and then retrieve
them when needed. Storing the Word document seems to be no problem but where
I am stuck is on retrieving them and then displaying the Word documents as
through ASP.NET it will be on the server i think.

Does anybody know of any articles, best practices or advice that will allow
me to crack this problem.

Many thanks for your guidance in advance.

R
Nov 18 '05 #1
3 5934
I am sure there are some articles. The basic of outputting as a different
type is changing the mime type of the response. To get the document out, you
will stream directly to HTTP, as it is the most efficient. What this means is
the display page is an ASPX without any ASPX tags (just the @ directive) and
you will be manipulating the type in the response header in your CodeBehind.

In addition, you may have to set up IIS to recognize Word as a valid MIME
type.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************

"richi" wrote:
Hello, i'm hoping that somebody can point me in the right direction with my
problem.

I have been tasked with creating a simple browser based application that
will allow the user to upload Word documents to SQL Server and then retrieve
them when needed. Storing the Word document seems to be no problem but where
I am stuck is on retrieving them and then displaying the Word documents as
through ASP.NET it will be on the server i think.

Does anybody know of any articles, best practices or advice that will allow
me to crack this problem.

Many thanks for your guidance in advance.

R

Nov 18 '05 #2
On your aspx page that's supposed to show the word document write:

<%@ Page language="c#" Codebehind="Exp ortToWord.aspx. cs"
AutoEventWireup ="false" Inherits="WebTr y001.Graph.Expo rtToWord" %>
<% RenderWordData (); %>

and on the code-behind write:

protected void RenderExcelData ()
{
Response.Conten tType = "applicatio n/ms-word";
Response.AddHea der("Content-Disposition",
"inline;filenam e=MyReport.doc" );

//here save the content of your document to Response.Output Stream ...

}

hope it helps.
"Cowboy (Gregory A. Beamer) - MVP" <No************ @comcast.netNoS pamM> wrote
in message news:73******** *************** ***********@mic rosoft.com...
I am sure there are some articles. The basic of outputting as a different
type is changing the mime type of the response. To get the document out,
you
will stream directly to HTTP, as it is the most efficient. What this means
is
the display page is an ASPX without any ASPX tags (just the @ directive)
and
you will be manipulating the type in the response header in your
CodeBehind.

In addition, you may have to set up IIS to recognize Word as a valid MIME
type.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** ************
Think Outside the Box!
*************** ************

"richi" wrote:
Hello, i'm hoping that somebody can point me in the right direction with
my
problem.

I have been tasked with creating a simple browser based application that
will allow the user to upload Word documents to SQL Server and then
retrieve
them when needed. Storing the Word document seems to be no problem but
where
I am stuck is on retrieving them and then displaying the Word documents
as
through ASP.NET it will be on the server i think.

Does anybody know of any articles, best practices or advice that will
allow
me to crack this problem.

Many thanks for your guidance in advance.

R

Nov 18 '05 #3
Many thanks for your help.

If anybody knows of any documents or sample applications to look at I would
be gratefull if you could provide the URL.

Thanks

R
Nov 18 '05 #4

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

Similar topics

2
3949
by: Pat Sheen | last post by:
In IE6 I'm using the following html to have three frames. One of the frames is to open a locally stored MS Word document. <frameset rows="100,1*"> <frame name=SiteHdr src="Development\SiteHeader.html"> <frameset cols="50%,50%"> <frame name=Notes src="file://C:/Documents%20and%20Settings/NotesStarter.doc"> <frame name=Site src="http://www.google.com.au">
3
5588
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge document in Word; 2. opens the document and runs the merge process for the new data. I have managed to write the code to perform step 1 ok, but I'm having trouble with step 2. It opens the word document fine but does not perform the mail merge of...
4
11134
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone done this? Does it seem possible? I followed the instructions from a sample on the Microsoft knowledge base but it only seems to work when creating a VB.NET Windows .EXE, not an VB.NET ASP app.
3
6131
by: Yohancef Chin | last post by:
Hi, Being fairly new to .NET I am looking for a way to call MS Word from an event on a webform, and after the user is finished save that created document to an SQL Server database. Has anyone done this? Does it seem possible? I followed the instructions from a sample on the Microsoft knowledge base but it only seems to work when creating a VB.NET Windows .EXE, not an VB.NET ASP app.
4
2513
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 Interop Assemblies (PIAs) for automating Word on the server and everything runs smoothly on the server console. The word documents are generated perfectly from all clients and stored on the server with some data comes from a SQL server and/or stores...
4
2034
by: enak | last post by:
I need to open a Word template so that I can merge some data from a database with the document. I am using ASP.NET, VB.NET. I can not even get MS Word to be visible. I can see that an instance is created in Task Manager. Here is my code: Private Sub createReport() Dim missing As Object = System.Reflection.Missing.Value Dim file_name As String Dim file_path As String
2
3379
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to confirm that I want to run a query to select the data from the data source file, then it opens the form letter fine. I can preview the merged records and complete a merge to a new document. I have a VB 2006 project (.net framework 2.0) which opens the...
4
4721
by: Q | last post by:
Hello you all, I have to write a .NET application (VB.NET) where the user can open spreadsheets, word documents, pdf documents, textfiles.... from within the same window. I was thinking of using a RichTextBox but that doesn't seem to do the job. The files itselfs come from within a SQL-database. They are stored as a binary field (using BLOB). Any suggestions??
4
3460
by: dasnowball | last post by:
Hi everyone, I'm developing an application using ASP.NET with VB, connected to a SQL Server, running on .NET 2 framework. I am developing a training system where documents are uploaded into the system and a test is defined. The problem I am having is when users need to view these documents. Currently, they select which item they wish to complete training on, and by clicking the start test button, it pulls the location of this document...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10093
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9952
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8976
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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 we have to send another system
3
2880
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.