n this post, we want to discuss about a nice function to convert text to title case (Proper Case) in SQL Server. Before we get started, if you want to know about split with any delimited string, please go through the following article: Create File Copier with C#.

Let’s start to export datatable to excel using c#:

Step 1: In design page, set EnableEventValidation =”false” in “%@ Page” tag in top

Step 2: In design page, If there is “Update Panel” then add the exporting button (Its my button when clicked will export grid data to Excel format like btnExportToExcel) in  ” asp:PostBackTrigger ” not in “asp:AsyncPostBackTrigger“. So we will get

Step 3: In code page, add the following function

Step 4: Add this code to generate excel

YOUR CODE WILL NOW DOWNLOAD EXCEL CONVERTED DOCUMENT…. CONGO!

 

Leave a Reply