0

Is it possible to import sql server data in to Excel using c#?

If so, how can I do this?

0

2 Answers 2

1

some links to help you out:

Links:

http://dotnetguts.blogspot.com/2007/12/export-datagrid-to-excel-in-aspnet.html

http://msdn.microsoft.com/en-us/library/ms173186(VS.80).aspx

http://www.codeproject.com/KB/cs/Excel_and_C_.aspx

http://support.microsoft.com/kb/302084

http://www.dotnetfunda.com/articles/article1150-all-in-one-export-data-in-aspnet-gridview-to-doc-gridview-to-excel-gr-.aspx

Sign up to request clarification or add additional context in comments.

Comments

0

Yes. It is possible even using C++ and ODBC :)

To do it in C#, you need to create Excel document object. To create Excel Document object, you need first to create reference to Microsoft Excel Object Library. Then read the data from SQL Server using ADO.Net. Then insert this data into opened Excel document object. Then you need to save this Excel document.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.