Tag Archives for C#

Taking SPQuery To The Max

Written by: Johnny Bouder Subscribe to this Author's RSS feed

Recently I was working on a project which utilizes SharePoint to store backend data for a ticketing system. The layout of the data is a bit relational, much like SQL tables. In fact, some would say that it probably should be stored in SQL directly, but I disagree. I agree that using SharePoint lists will […]

Creating a Custom SharePoint Calendar Rollup

Written by: Johnny Bouder Subscribe to this Author's RSS feed

A few months ago I had a requirement to rollup multiple SharePoint 2010 Calendars into one centralized calendar. I initially thought, “overlays make that a piece of cake!” Little did I know, I was about to embark on a much longer adventure than I anticipated… It wasn’t long after I started adding the calendar overlays […]

Storing Credentials in a SharePoint Property Bag

Written by: Johnny Bouder Subscribe to this Author's RSS feed

I recently posted about storing credentials in the Secure Store Service, and based on a few comments, I figured I should also post about storing credentials in the property bag. For this post I’m just going to keep it real simple and provide a few notes and the code (please don’t hesitate to ask for […]

Storing Connection String Information in the Secure Store Service

Written by: Johnny Bouder Subscribe to this Author's RSS feed

As a SharePoint developer, i’ve been tasked a few times with pulling data from an external database into SharePoint. More often than not, that data is secured SQL data and needs to be accessed using a SQL account, which means I’m going to have to access that data using a connection string. Generally that’s a […]

Open XML in the Sandbox

Written by: Johnny Bouder Subscribe to this Author's RSS feed

Sometime back I was given the task of taking information in an email and automating it into a specifically formatted word document (kind of a strange request I know). With me being a complete OpenXML noob, I have to admit it turned out to be much more difficult than I originally thought. Also, I had […]

C# Generator best practices

Written by: Lee Kohn Subscribe to this Author's RSS feed

A while back C# introduced generators (through the use of yield return) which is a very handy/powerful construct if used properly.  However if your not careful there are a few gotchas which novice developers may not be aware of: Resource Cleanup If code inside of the generator is using any resources which need to be […]

Connection errors with application pages

Written by: Charles Stumpf Subscribe to this Author's RSS feed

Periodically, I have overzealous users who refresh the page even when the load time is < 1 second. Within my application pages, I’d receive errors similar to “internal connection fatal error”. The problem wouldn’t end after the refresh, though. It would cause errors on all database connections, for all users, and it would last for […]

ReaderWriterLock vs. ReaderWriterLockSlim Performance

Written by: Lee Kohn Subscribe to this Author's RSS feed

Here is handy comparison of the performance ReaderWriterLock and ReaderWriterLockSlim: ReaderWriterLock ReadLock -> Release Lock = 0.00014 ms WriteLock -> ReleaseLock = 0.00012 ms ReadLock -> UpgradeToWriteLock -> ReleaseLock = 0.00021 ms   ReaderWriterLockSlim ReadLock -> ExitReadLock = 0.00005 ms WriteLock -> ExitWriteLock= 0.00004 ms ReadLockUpgradeable -> WriteLock -> ExitWriteLock -> ExitReadLock  = 0.00009 ms   So […]

Injecting and Running Javascript in a Windows.Forms.WebBrowser control

Written by: Lee Kohn Subscribe to this Author's RSS feed

Have you ever needed to inject some JavaScript into a web-page contained in a WebBrowser control and then run said code?  If you have then you’re in luck; here is some sample code which accomplishes exactly that in a console application (the same code works for a WinForms application with a few tweaks): To see […]

Mostafa Extends His Microsoft MVP Streak to Five Years in a Row

Written by: MetroStar Marketing Subscribe to this Author's RSS feed

Another year has passed here at MetroStar Systems and yet another Microsoft Most Valuable Professional (MVP) Visual C# award has been bestowed upon our own Mostafa Elzoghbi. In what has seemingly become an annual occurrence, Elzoghbi secured a Visual C# MVP award for the fifth consecutive year. This exclusive award is given to those who […]