C# Reading Outlook Contacts
Read the default Outlook contacts folder from C# using the Outlook interop assembly and return them as a DataSet.
using Microsoft.Office.Interop.Outlook;Articles, code snippets and news worth sharing.
Read the default Outlook contacts folder from C# using the Outlook interop assembly and return them as a DataSet.
using Microsoft.Office.Interop.Outlook;A generic JavaScript function to capture a key press and run logic, such as clearing a field on backspace.
function CheckKey(e) {
var keynum;
if (window.event) // IE
{
keynum = e.keyCode;
}PowerShell script to create the Word Automation Services service application in SharePoint 2010.
$serviceName = "Word Automation Service"
$appPool = $null
Add-PSSnapin Microsoft.SharePoint.PowerShell
$appPool = Get-SPIisWebServiceApplicationPool -Identity <appPoolName>
if ($appPool -eq $null)A first look at the Visual Studio 11 Beta, with the splash screen and the main IDE window.
A query that returns every trigger in a database with its table, type and whether it is disabled.
USE YourDBName
GO
SELECT trigger_name = sysobjects.name,
trigger_owner = 'x',
table_schema = s.name,
table_name = OBJECT_NAME(parent_obj),Open a page in a SharePoint 2010 modal dialog from JavaScript and handle the result when it closes.
var options = SP.UI.$create_DialogOptions();
options.width = 450;
options.height = 450;
options.url = "/_layouts/PageName.aspx";
options.showClose = true;
options.title = "Dialog Title";Return all tables in a SQL Server database by querying sys.tables.
USE YourDBName
GO
SELECT *
FROM sys.tablesList every stored procedure in a database using INFORMATION_SCHEMA.ROUTINES.
SELECT * FROM
DatabaseName.information_schema.routines
WHERE routine_type = 'PROCEDURE'Populate a dropdown list from a JSON service using $.getJSON and $.each.
$.getJSON("URL", null,
function (data) {
$.each(data.d, function (i, result) {
var optionText = "<option value='" + result.value + "'>"
+ result.text + "</option>";
$('#ddlSelectTagId').append(optionText);The fastest way to empty a select element: replace it with a shallow copy of itself.
function ClearOptions(id) {
var selectObj = document.getElementById(id);
var selectParentNode = selectObj.parentNode;
var newSelectObj = selectObj.cloneNode(false); // shallow copy, no options
selectParentNode.replaceChild(newSelectObj, selectObj);
return newSelectObj;A reusable $.ajax template for calling a JSON service with success and error callbacks.
$.ajax({
url: GETURL,
type: "GET",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: successCallback,How to declare abstract classes and abstract members in C#, and how a derived class overrides them.
abstract class Stream
{
public abstract void Write(char ch);
public void WriteString(string s)
{
foreach (char ch in s) Write(ch);