I want to download an Excel file containing the data from a SQL Server table in C#.
What is the best way to get it?
I want to download an Excel file containing the data from a SQL Server table in C#.
What is the best way to get it?
As mentioned there is tons of options you can choose between. For most cases the easiest way is to make a CSV file also known as comma seperated file. The idea of a CSV file is to make a line for each row of your table and seperate each column with semicolon. Example for the header string could be "id;firstname;lastname;phonenumber;". Then your file should be named *.csv. Then you open your csv file i excel or any similar program.