Posts

Showing posts from July, 2014

Read excel file using C# and .NET

Image
With C#, we can read excel file data and can store it into DataTable object easily. To do this, you may need to install and prepare development environment as well in the system wherever you want to deploy this application. This is one of the probable solution and is not limited to. Also, I have developed and tested this in Windows environment only, no idea about other OS. Development environment: OS Windows 7 32bit, VS 2012, Excel 2013. Prerequisites: 1. Download and install " Data Connectivity Components ". 2. Register msexcl40.dll located in C:\Windows\System32 3. Register oledb32.dll located in C:\Program Files\Common Files\System\Ole DB Create an excel file. Here, I have created with name Test.xlsx as shown in figure below. Lets move to C# code. To work with excel file, you need an OledbConnection object to communicate with the .xls/.xlsx file. OLEDB (Object Linking and Embedding, Database) is an API designed by Microsoft to access

Debugging windows service in .NET without process attachement

Image
This concept is not developed by me. I got it over the net while working with my windows service and found really good. Therefore, I wish to share it with you. Hope you will love it and can debug your windows service without attaching any process. The complete article can be read here . The same code, given below, I have pasted in Program.cs and I could debug my service as a normal application.

HTTP Error 500.21 - Internal Server Error: ExtensionlessUrlHandler-ISAPI-4.0_32 bit has a bad module

Image
HTTP Error 500.21 - Internal Server Error Handler "ExtensionlessUrlHandler-ISAPI-4.0_32bit" has a bad module "IsapiModule" in its module list Solution: By changing following settings with IIS and .config file, you can fix this issue. Step: 1. Reorder the handlers in your .config file and make ExtensionlessUrlHandler-ISAPI-4.0_64bit as default.                                                   Step: 2. Set framework version to "ASP.Net v4.0" in application pool it has assigned. I could resolved my issue with these two changes.