Hi, you can use the .NET porting of the Java API Apache POI; I've found it very useful (and powerful):
http://npoi.codeplex.com/
And here a reference to the original java one: http://poi.apache.org/
In your C# project, you only need to retrieve data via SqlConnection class(http://www.codeproject.com/Articles/4416/Beginners-guide-to-accessing-SQL-Server-through-C), manipulate them in they way you want, then export them with the POI API.
TO ACCESS:
You have to retrieve data with SqlConnection class and write them with OleDbConnection class (which provides you the methods to manage Access databases, try this tutorial: http://www.dreamincode.net/forums/topic/33979-oledb-data-objects-in-c%23/)
If you can access the SQL-server data from C#, you can create the data to a text file as csv file eg mydata.csv. Excel can open csv files.
If the data is opened from Notepad, what you saved in the mydata.csv file would look like:
ColA_Heading, ColB_Heading, ColC_Heading
152.55, 45.588, 45.588
152.55, 45.588, 45.588
152.55, 45.588, 45.588
152.55, 45.588, 45.588
152.55, 45.588, 45.588
152.55, 45.588, 45.588
152.55, 45.588, 45.588
The file does not have any formatting.
If you are familiar with xml, you can also create an xml file format of the data from C# for excel or even your browser (eg Chrome/IE) to read. You can create a formatting for the data as you wish and save as mydata.xml.
This is just a simple way to handle that problem from C#.
You can query SQL server data directly from SQL server and export your data from the query grid to Excel.
Access is a database itself with some structure, so this may be more involved.
Amir, its really quite simple. If you've already got a copy of the SQL database, then use sql express on your local computer and visual studio to create a form. You can also connect to a remote SQL database via visual studio. There's a few built-in commands in c# for direct access to the fields in a table. You query the table much in the same way as you would using an SQL command. The best way to retrieve the data is into a data table or dataset in c# and then present it in a list view or grid view.
You can use a library called ExcelLibrary. It's a free, open source library posted on Google Code. This library takes your table and creates the excel worksheet from it.