473,789 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS/Word, PDF ?

WJ
I have documents written in MS/Word (Doc), Ascii Text, and Adobe Acrobat
(PDF) formats. They are of type "Image" stored in SQL server. How do I
display these documents to the Asp.Net page ? I retrieve the documents in
byte array using c# via Sql Procedure.

Thanks,

John Webbs
Nov 19 '05 #1
4 3748
Create an empty .aspx page. Then, in Page_Load() you could write something
like:

Response.Clear( );
Response.Conten tType="applicat ion/word";
Response.Output Stream.Write(.. .)

HTH,
Axel Dahmen
www.sportbootcharter.com

------
"WJ" <Jo*******@HotM ail.Com> schrieb im Newsbeitrag
news:ec******** ******@TK2MSFTN GP09.phx.gbl...
I have documents written in MS/Word (Doc), Ascii Text, and Adobe Acrobat
(PDF) formats. They are of type "Image" stored in SQL server. How do I
display these documents to the Asp.Net page ? I retrieve the documents in
byte array using c# via Sql Procedure.

Thanks,

John Webbs

Nov 19 '05 #2

You must change the Response Type and just write your byte array.
For example:
Response.Conten tType = "applicatio n/ms-word"; // or PDF !
Response.AddHea der("Content-Disposition",
"attachment;fil ename=word.doc" );
Response.Write( byteArray);

See more on : http://www.ondotnet.com/pub/a/dotnet...04/01/asp.html
or http://www.eggheadcafe.com/articles/20011006.asp

Lionel.
"WJ" <Jo*******@HotM ail.Com> a écrit dans le message de news:
ec************* *@TK2MSFTNGP09. phx.gbl...
I have documents written in MS/Word (Doc), Ascii Text, and Adobe Acrobat
(PDF) formats. They are of type "Image" stored in SQL server. How do I
display these documents to the Asp.Net page ? I retrieve the documents in
byte array using c# via Sql Procedure.

Thanks,

John Webbs

Nov 19 '05 #3
WJ

"Axel Dahmen" <NO*****@NoOneK nows.invalid> wrote in message
news:eW******** ******@TK2MSFTN GP12.phx.gbl...
Create an empty .aspx page. Then, in Page_Load() you could write something
like:

Response.Clear( );
Response.Conten tType="applicat ion/word";
Response.Output Stream.Write(.. .)

Excellent. Thank you!

John
Nov 19 '05 #4
WJ

"Lionel LASKE" <ll****@c2s.f r> wrote in message
news:uj******** ******@tk2msftn gp13.phx.gbl...

You must change the Response Type and just write your byte array.
For example:
Response.Conten tType = "applicatio n/ms-word"; // or PDF !
Response.AddHea der("Content-Disposition",
"attachment;fil ename=word.doc" );
Response.Write( byteArray);

See more on : http://www.ondotnet.com/pub/a/dotnet...04/01/asp.html
or http://www.eggheadcafe.com/articles/20011006.asp

Excellent. Thank you!

John
Nov 19 '05 #5

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

Similar topics

8
3538
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word templates, and the queries that drive them, depending on what events a course has.
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.
2
13535
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to execute a MailMerge to create mailing labels or customized letters. A label name known to MS Word MailMerge mailing label wizard may be used or a template file containing the field names Line1 thru Line5 for each record to be printed. If a...
7
6251
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the user and populated (with info from an Access database) at run-time, then saved as Word documents. The program I have coded works fine -- it does what I need it to do. But it has two problems: (1) it runs very slowly, and (2) it does not seem to...
4
12443
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
1
3013
by: beanie | last post by:
i am a c programming beginner and i am trying to Create a concordance of Word Count for a text File in c programming but my code isn't working.please can u help me out.here is my code: #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> struct word { struct word *left; /* tree to the left */ struct word *right; /* tree to the right */ char *WORD;
2
4965
by: beanie | last post by:
i am a beginer in c programming and i am trying to Create a Concordance of Word Count for a Text File but my code is not working.pls can anyone helpme out.here is my code: #include <stdio.h> #include <ctype.h> #include <string.h> #include <stdlib.h> struct word { struct word *left; /* tree to the left */ struct word *right; /* tree to the right */ char *WORD;
0
1928
by: alivip | last post by:
I write code to get most frequent words in the file I won't to implement bigram probability by modifying the code to do the following: How can I get every Token (word) and PreviousToken(Previous word) and frequency and probability From text file and put each one in cell in table For example if the text file content is "Every man has a price. Every woman has a price." First Token(word) is "Every" PreviousToken(Previous...
5
2540
by: alivip | last post by:
How can I get every Token (word) and PreviousToken(Previous word) From multube files and frequency of each two word my code is trying to get all single word and double word (every Token (word) and PreviousToken(Previous word)) from multube files and get frequency of both. it can get for single word but double word give error line 50, in most_frequant_word word1+= ' ' + word_list IndexError: list index out of range import...
1
4399
by: dittytwo | last post by:
Hi there The below code works if you don't try to do anything to the word document which is great (Not :D) I am having problems with the context command both text (i.e initial document with no text) or a subsequent addition of text, insert, to the document. as this is going to be used along side other com opened applications Excel power point etc. it needs to work in the self.X orientation as i can get it to work normally see code 2 ...
0
9656
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...
0
10374
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10124
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
9969
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
8998
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...
0
5540
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2898
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.