Tag Archives | Programming

Foreach C#

A program iterates over a collection. The index of each element is not needed. Only the elements are needed. With foreach we access just the elements. A foreach-loop, this is the easiest, least error-prone loop. It is preferred in many program contexts. Here are some samples: using System; class Program { static void Main() { […]

Read full story Comments { 0 }

Visual Studio 2015 keyboard shortcuts – The complete list

Analyze Navigate Backward Shift+Alt+3 Navigate Forward Shift+Alt+4 Architecture New Code Map Ctrl+\, Ctrl+O New UMLor Layer Diagram Ctrl+\, Ctrl+N Architecture Context Menus Add Node Ins Both Dependencies B Incoming Dependencies I Outgoing Dependencies O New Comment Ctrl+Shift+K Ctrl+E, C Remove Del Rename F2 Build Build Solution Ctrl+Shift+B Cancel Ctrl+Break Compile Ctrl+F7 Run Code Analysison Solution […]

Read full story Comments { 0 }

Find and extract numbers from a string c#

Read full story Comments { 0 }

Limit DateTimePicker to 30 minute intervals C#

I am creating an AddIn for Outlook and I want to create DateTimePicker where I want to select a Time in interval of 30 minutes. In KeyDown event where  the user presses up or down it will increment or decrement the time in interval of 30 minutes.    

Read full story Comments { 0 }

LINQ
 to 
SQL 
in 
C# – Cheat Sheet

LINQ
 to 
SQL
 in
 C# – Cheat
 Sheet Database context & database create var db = new MyDataContext(@”server=.\SQLEXPRESS;database=my;integrated security=SSPI”); if (!db.DatabaseExists()) db.CreateDatabase(); Select one Insert var only = db.Customers.SingleOrDefault(c => c.CustID == “CHIPS”); var first = db.Customers.FirstOrDefault(c => c.CustID == “CHIPS”); var customer = new Customer() { CustID = “CHIPS”, CompanyName = “Mr. Chips” }; […]

Read full story Comments { 0 }

C# Cheat Sheet for Java Developers

C# for Java Developers – Reference List Source: download.microsoft.com

Read full story Comments { 0 }

Built-in C# Data Types

C# is a strongly-typed language. Before a value can be stored in a variable, the type of the variable must be specified, as in the following examples: int a = 1; string s = “Hello”; XmlDocument tempDocument = new XmlDocument();   Note that the type must be specified both for simple, built-in types such as […]

Read full story Comments { 0 }

ASP and VBScript Cheat Sheet

ASP and VBScript Cheat Sheet

Read full story Comments { 0 }