0

I want to to download an excel attachment from outlook inbox (saving it in the application folder) and then save the data of excel sheet to sql server table in C# Console Application. Could you help me in achieving this?

Thanks.

Javed Ahmed
  • 406
  • 5
  • 21

1 Answers1

0

Basically you have two ways: calling Outlook that's installed on client computer and calling server (Exchange?) for this.

Outlook way. First you need to logon. Read here http://msdn.microsoft.com/en-us/library/ff869819.aspx about it. Then read more here http://msdn.microsoft.com/en-us/library/ff863719.aspx and http://msdn.microsoft.com/en-us/library/ff870432 . Yes, some examples are in VB, you'd have to translate them into C#. Also take a look here C# MAPI to read exchange server inbox

Exchange way. Search google for IMAP C# example.

To save to SQL Server you need to create table with a BLOB field and insert data into it, for example, via ADO.NET. Search google for ADO.NET and ADO.NET blob and surely you'd get many examples.

Community
  • 1
  • 1
Dmitry Osinovskiy
  • 9,999
  • 1
  • 47
  • 38