I\'m trying to develop a c#/asp.net application to extract data from a SQL server and have it formatted in an excel spreadsheet. I have been practicing with excel object mod
You 'can' use Excel automation on the server side. However you will be breaching licences ,may run into security problems and generally experience other odd behaviour, especially if you have more than one user using it at a time. I would suggest that you dont do it.
If the data you want to write is simple enough just do it as a csv
If not and you really have to write a spreadsheet look for a 3rd party component that writes excel files. I only know of one off the top of my head and thats Aspose.Cells, but that is quite expensive.