excel
excel
Thought I would put this up here for future reference. #1 Helped me figure out how to retrieve a region within an excel sheet instead of the whole sheet. I didn’t know you could do things like “SELECT * FROM [Sheet1$A1:B10]” which will only retrieve the values with those rows and columns. You can also retrieve data inside named ranges. If you want to be able to figure out the name of the first worksheet, then have a look at link #2. You have to get it out of the database schema. Very useful....
I was trying to write a simple application the other day that exported data from sql server to excel for the user to edit it and then import the updated excel back into sql server. There’s lot of help online about how to export gridview to excel. Here’s what I came up after looking at various examples: Protected Sub exportExcel()
'Clear the response, and set the content type and mark as attachment
HttpContext.Current.Response.Clear()
...