473,387 Members | 1,863 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.

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 5901
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="ExportToWord.aspx.cs"
AutoEventWireup="false" Inherits="WebTry001.Graph.ExportToWord" %>
<% RenderWordData (); %>

and on the code-behind write:

protected void RenderExcelData ()
{
Response.ContentType = "application/ms-word";
Response.AddHeader("Content-Disposition",
"inline;filename=MyReport.doc");

//here save the content of your document to Response.OutputStream ...

}

hope it helps.
"Cowboy (Gregory A. Beamer) - MVP" <No************@comcast.netNoSpamM> wrote
in message news:73**********************************@microsof t.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
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...
3
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...
4
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...
3
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...
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...
4
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...
2
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...
4
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...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.