Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
eqx eqx is offline
external usenet poster
 
Posts: 1
Default Saving Excel Sql Server Image Field

I have a document module function running a my website that displays txt,
pdf, xls, ppt, doc files that are stored in a Sql Server 2000/2005 database
table (image field). I would like to write a function triggered from a button
event that saves the spreadsheet directly to the database table.

I have 2 scenarios:

1) This routine writes the file disk and using VB.Net ADODB.Stream, saves to
the database. I would like to remove the save to disk code and convert
"This.Application" to an internal in-memory/in-process object which can be
written to the database.

======= Code Sample 1 ==============================
** VSTO Button Event Invokes SaveAs method and save to disk.
Dim AttachFileStream As New ADODB.Stream
AttachFileStream.Type = ADODB.StreamTypeEnum.adTypeBinary
AttachFileStream.Open()
AttachFileStream.LoadFromFile(fname)
rs = New ADODB.Recordset
rs.AddNew()
rs.Fields("reportFile").Value = AttachFileStream.Read
rs.Update()
AttachFileStream.Close()
========== End ====================


2) Office Automation Executable in VB.Net (Visual Studio 2005)

========== Code 2 ==================
myExcelApp = New Excel.Application <== creates Excel via VB.net Windows app
========== End ====================

As with example #1 above, I would like to save "myExcelApp" directly to
SqlServer 2000/2005.

Thanks for your help.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving Excel workbook in SQL server using c# Jitender Khanna[_2_] Excel Programming 1 October 10th 05 07:27 AM
Saving Excel workbook in SQL server using c# Jitender Khanna Excel Discussion (Misc queries) 0 October 10th 05 06:52 AM
Saving Excel workbook in SQL server using c# Jitender Khanna[_2_] Excel Programming 0 October 10th 05 06:20 AM
Saving Excel workbook in SQL server using c# Jitender Khanna Excel Programming 0 October 10th 05 06:08 AM
Read Image From SQL Server n Export to Excel Budiono Excel Programming 0 September 5th 03 10:02 AM


All times are GMT +1. The time now is 12:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"