Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2004, 07:37 AM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default Saving Word file into Database

Hi there:
I wanna save MS-Office Word file into MS-SQL Server 2000 (file contents) using C#.
Can anyone help me. Any idea or sample will be appreciated & [u]unforgettable</u>.

Always:),
Hovik Melkomian.
__________________
Always,
Hovik Melkomian.
Reply With Quote
  #2 (permalink)  
Old November 21st, 2005, 04:05 AM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

do you have found a solution?
I'm very intresting in it...

Regards
Andi

Reply With Quote
  #3 (permalink)  
Old November 21st, 2005, 01:40 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Post this question in one of the ASP.NET forums..

Reply With Quote
  #4 (permalink)  
Old November 22nd, 2005, 03:57 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Use a byte array. The following example illustrates:

int len = Upload.PostedFile.ContentLength;
byte[] pic = new byte[len];
Upload.PostedFile.InputStream.Read (pic, 0, len);
// Insert the image and comment into the database
SqlConnection connection = new SqlConnection _ (@"server=Servername;database=databasename;uid=sa;pwd=password");
try
{
connection.Open ();

SqlCommand cmd = new SqlCommand ("insert into Image " + "(Picture, Comment) values (@pic, @text)", connection);

cmd.Parameters.Add ("@pic", pic);
cmd.Parameters.Add ("@text", Comment.Text);
cmd.ExecuteNonQuery ();


Reply With Quote
  #5 (permalink)  
Old November 28th, 2005, 09:12 AM
Registered User
 
Join Date: Nov 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. It works.

Andi

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating database & saving it to another file OnceANewbie VB Databases Basics 1 December 1st, 2008 06:58 AM
How to store MS Word File in database kesar SQL Language 2 March 1st, 2007 06:34 AM
Saving/Retrieving Image file to Database davekrunal46 VB How-To 6 January 11th, 2006 04:41 AM
Saving Word File In SQL Server abdul_wasie Classic ASP Databases 0 May 20th, 2005 06:05 AM
Saving Word file into Database melvik C# 0 March 8th, 2004 07:36 AM



All times are GMT -4. The time now is 04:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.