Skip to content

Category Archives: .Net

Import Data from Excel using C# – Part 2

16-Feb-10

In my web application, we used to import data from MS Excel file. Few days before one of the client representative posted an issue that he can’t import data from XLSX (MS Excel 2007 File Format) files. Previously we were using OLE DB provider to import data from Excel file (Checkout my previous post regarding [...]

System.InvalidOperationException – Cross-thread operation not valid

05-Feb-10

System.InvalidOperationException – Cross-thread operation not valid: Control ‘xxxxx’ accessed from a thread other than the thread it was created on. Normally we get this exception when we try to modify some control property from another thread. This is because when a program executes the operating system will assign a thread for the creation of UI [...]

Encrypting and Decrypting Configuration Sections

04-Feb-10

Recently I got chance to work with security audit team for my web application, and one suggestion I got from them is to encrypt connection strings section in web.config. I thought it involves lot of coding changes, and I was not aware of ASP.Net utility which will help to encrypt and decrypt the connection strings [...]

Isolated Storage in C#

03-Feb-10

As I am working in a Windows Application, client asked about the Windows 7 and Windows Vista compatibility. As I was writing only managed code I was not worried about the compatibility and most of the time it was working fine. (I was using Windows Vista). Today evening one of my colleague was testing the [...]

Writing File with Non Cache mode in C#

19-Jan-10

Normally when we are writing to the File Systems or I/O devices, Windows will cache the request or response to get better performance. This behavior is a good feature, but sometimes we require immediate change. By caching Windows sometimes mislead us. And I don’t think there is a way to avoid this option available in [...]