Writing Data From .Net to Excel Interrupted by User Opening Excel Window

Problem I have an application that generates financial reports in excel. After installing Office 2013, if a user opens excel while the application is running, the application returns a error: System.Runtime.InteropServices.COMException with HRESULT: 0x800AC472 which interrupts the data from being written to the spreadsheet. After some research according to Microsoft this was done by design, the … More Writing Data From .Net to Excel Interrupted by User Opening Excel Window

OAuth2 – Get an Access Token – C#

What is OAuth2? OAuth 2.0 is the industry-standard protocol for authorization. OAuth 2.0 supersedes the work done on the original OAuth protocol created in 2006. OAuth 2.0 focuses on client developer simplicity while providing specific authorization flows for web applications, desktop applications, mobile phones, and living room devices. reference: https://oauth.net/2/ Who uses OAuth2? Among them … More OAuth2 – Get an Access Token – C#

Error The “GenerateResource” task failed unexpectedly.

Problem I was enhancing an application that I have been working with for years, without any trouble. This application was developed with Visual Studio and the solution has multiple projects. While I was working on the enhancements I did some refactoring and renamed some of the classes and files on the application. All of the “sudden” … More Error The “GenerateResource” task failed unexpectedly.

Focus – Pocus

Last week, as the first North East blizzard of 2016 approached, my inner hermit rejoiced at the prospect of being stuck at home, and having the opportunity of tackling those chores that are frequently put on the back burner when outside shinny things are dangled in from of me. Jonas was the perfect opportunity to finish … More Focus – Pocus

Refactoring I -Convert Linq Anonymous Types to List

Refactoring is an important process to crafting readable and maintainable code. Functions should follow  the single responsibility principle – a function should do one thing and one thing only and should have few lines of code. Like with everything, you should apply this with measure and wisdom. I was asked to write a function that … More Refactoring I -Convert Linq Anonymous Types to List

Transact-SQL Server – Transposing a table

The Problem A client sent me an excel sheet with financial information classified in columns where each column header was a date and the values associated with that date were listed below I needed to insert the information to a normalized table with the following columns: Client Account EntryDate Value The Solution Step 1 Loaded … More Transact-SQL Server – Transposing a table

Books every software developer should read in 2016 – if you have not done so

The obligatory reflection on what have we accomplished in 2015 … always a sticky question. But if keep it to my book, training and research, it does not look that bad, I managed to keep the momentum going. Software Development Cracking the coding Interview – Gayle Laakman This is a great book with brain teasers and … More Books every software developer should read in 2016 – if you have not done so

Transfer database permissions on all objects from one SQL server to another – MS SQL Server 2008 – 2014

The Problem I needed to migrate all databases from a MS SQL server 2008 R2 to MS SQL Server 2014; while I can create and restore my databases, permission in objects live on the system databases, therefore I needed to transfer all my login and data objects from one server to another. This cannot be … More Transfer database permissions on all objects from one SQL server to another – MS SQL Server 2008 – 2014