Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do you export data with about 40 fields or more to generate 40 columns or more in excel from C# clint and MS-SQL-SERVER

What I have tried:

Works well with crystal report writer with a limited number of fields say up to 15 fields
Posted
Updated 9-Apr-19 5:54am
Comments
[no name] 9-Apr-19 10:55am    
Any number of ways. Depends on what you are doing with the "export". Don't know? Then you're probably actually looking for a "backup". Then you can "restore" or "import" or "install" ....

Check this question and answers: How to upload excel file to db when sheet name is unknown C#[^]

There you'll find a method to read Excel file and upload data to MS SQL Server.
Good luck!
 
Share this answer
 
If you really need to export the data as a file...

Export it from the database as XML. The number of columns is only limited by the number of columns you can have in Excel, and Excel can real XML files.

If you can, create a cdata connection in excel that will pull the data from the database without the intermediate "create a file" step.
 
Share this answer
 

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