Posts Categorized: .Net 4.0

Retrieving the COM class factory for component failed due to the following error: 800702e4.

Posted by & filed under .Net, .Net 4.0, Office Interoperability, Visual Studio, Windows Forms.

While working on some outlook C# application I got a COM exception like this. Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005. My code was simply straight forward, I was just creating the instance of the outlook application. And this code was used in a different [...]

Assembly Binding Redirection in .Net

Posted by & filed under .Net, .Net 4.0, ASP.Net, Windows Forms.

Today I come across an application crash due to version mismatch. The application executable was compiled using version 1.0.x.x, and we were using 6.2.x.x. Due to this version mismatch application was crashing. Unfortunately we don’t have the source code of this application with us. Later I got one solution using bindingRedirect. This configuration element will [...]

How to apply border color for TableLayoutPanel

Posted by & filed under .Net, .Net 4.0, Windows Forms.

The TableLayoutPanel control arranges its contents in a grid. TableLayoutPanel doesn’t have border color property, but you can write custom code in CellPaint event to create border. Here is the code snippet which will help you to create border and apply color for TableLayoutPanel Here is the screen shot of the Form in Design Time [...]

How to upload file to FTP server using C#

Posted by & filed under .Net, .Net 3.0 / 3.5, .Net 4.0, Windows Forms.

From .net framework 2.0 onwards .net supports FTP operations. Like HttpWebRequest and HttpWebResponse, for FTP operations, FtpWebRequest and FtpWebResponse classes are available, under System.Net namespace. Here is the code snippet, which will help you to upload a file to FTP server, using C#. And here is the GetFileData function, which will return byte array from [...]

How to create controls dynamically in asp.net and retrieve values from it

Posted by & filed under .Net, .Net 3.0 / 3.5, .Net 4.0, ASP.Net, CodeProject.

Sometimes you may require to create controls dynamically in asp.net. Because of asp.net page life cycle, you may loss the created controls on next post back(ASP.Net framework recreate the page on postback). You can resolve this issue by overriding LoadViewState() and SaveViewState() methods. LoadViewState() method restores view-state information from a previous page request that was [...]