4 Replies - 8878 Views - Last Post: 10 July 2012 - 11:15 AM Rate Topic: -----

#1 IrishCoder   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 37
  • Joined: 07-April 10

Inserting from C# into Excel template

Posted 10 July 2012 - 09:08 AM

Hey guys,

As the topic title would dictate im pretty much looking for a way to insert from my C# web application form values that it has pulled from my database and dump these values into an Excel template i have. What would be the correct way of going about doing this?

Thanks alot.
Is This A Good Question/Topic? 0
  • +

Replies To: Inserting from C# into Excel template

#2 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6330
  • View blog
  • Posts: 21,736
  • Joined: 05-May 12

Re: Inserting from C# into Excel template

Posted 10 July 2012 - 09:28 AM

I can tell you right off the bat that the incorrect way to do it is to using Office Automation. See http://support.microsoft.com/kb/257757

The good thing, though, is that the KB article also suggests some alternatives to using Office Automation, and it links to the appropriate SDKs and walkthroughs.

I've been getting the impression that people on this forum having been having some successes using LibXL: http://www.libxl.com/
Was This Post Helpful? 0
  • +
  • -

#3 AdamSpeight2008   User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: Inserting from C# into Excel template

Posted 10 July 2012 - 11:00 AM

LINQ to Excel
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6330
  • View blog
  • Posts: 21,736
  • Joined: 05-May 12

Re: Inserting from C# into Excel template

Posted 10 July 2012 - 11:13 AM

View PostAdamSpeight2008, on 10 July 2012 - 11:00 AM, said:



Oh, that looks nice!

Scanning the source code, it looks like it uses an OLEDB connection to get to the data in the spreadsheet.

This post has been edited by Skydiver: 10 July 2012 - 11:22 AM

Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008   User is offline

  • MrCupOfT
  • member icon

Reputation: 2298
  • View blog
  • Posts: 9,535
  • Joined: 29-May 08

Re: Inserting from C# into Excel template

Posted 10 July 2012 - 11:15 AM

I don't know if is it Read-Write or just Read.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1