Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to EXPORT data from SQL Server to MS Word using C#. NET ?
Posted
Comments
Sergey Alexandrovich Kryukov 31-Dec-11 2:54am    
What is stored in your database?
--SA
Cridbro 18-Apr-16 5:21am    
I believe what you're actually looking for is to do a mail merging in C#, that is a task of importing data from some external source into your document. For example you create a table inside your document and place special placeholders (merge fields) into it and when merging the table will be filled with rows (for each record in your source) and cells (that will have values of those records). The article above demonstrates this by using a C# dll for word.

Read here to learn how to read data from database table :
http://progzoo.net/wiki/C%23:Read_From_a_Database[^]

And have a look at here for an example of writing data into word document :
http://stackoverflow.com/questions/5766494/word-interop-app-to-write-text-to-the-end-of-an-open-document[^]

Also these pages are useful :
http://msdn.microsoft.com/en-us/library/w1702h4a.aspx[^]

http://support.microsoft.com/kb/316384[^]

And then mix these ideas together and write your own export data application.

Hope it helps.
 
Share this answer
 
Comments
NandaKumer 3-Jan-12 9:58am    
good links
Amir Mahfoozi 3-Jan-12 23:47pm    
Thanks Nanda.
RaviRanjanKr 3-Jan-12 14:02pm    
5+
Amir Mahfoozi 3-Jan-12 23:45pm    
Thanks Ravi :)
 
Share this answer
 
Comments
NandaKumer 3-Jan-12 9:58am    
good one
RaviRanjanKr 3-Jan-12 13:58pm    
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900