I would like to proudly announce the release and availability of my new Beginning C# and .NET 2021 Edition book, which was co-authored with Jon Reid. The book contains over 800 pages of material relating to the skills and knowledge required to become a great C# programmer. The book is designed around the premise that […]
Read More →Category: C# Fundamentals
Booleans and Bools in C#
In a job interview I had once, I was asked, “How do you store a Boolean in a database?” My first reaction was to say, True, False, 0, 1, Y or N. However, this question has some depth to it. I do not know why, if you do let me know, but there are no […]
Read More →Dictionary in C#
I am finding that as you learn to use and implement more sophisticated programming techniques the easier it becomes to created what many would call “complex algorithms”. I believe this, just think about what alternative you have to a Dictionary. I mean other than the similar methods found in the System.Collections or Systems.Collections.Generic classes. Configuration […]
Read More →Conditional Methods
One of, if not the most important concepts in software programming is that of Conditional Methods. Conditional methods provide a program with the ability to make decisions based on user input, user selections or data values. The code below is a simple example of a conditional method: [sourcecode language=”csharp” padlinenumbers=”true” autolinks=”false” gutter=”false” toolbar=”false”] public static […]
Read More →Interface in C#
An interface is like a contract. When a person signs a contract they are agreeing to perform in adherence to its’ contents. The person can take any action which is not specifically identified in the contract or build on top of the agreements within it. An interface has a similar concept. In this example I […]
Read More →Anonymous Method / Delegate
Delegates in C# are similar to function pointers in C++ and allow methods to be passed as parameters. In this example we will create a delegate called CalculateCharge and a Withdrawal class: [sourcecode language=”csharp”] delegate decimal CalculateCharge(decimal withdrawal); class Withdrawal { public string AccountOwnerName; public decimal withdrawal; public decimal charge; public CalculateCharge calculation; } [/sourcecode] […]
Read More →Arrays in C#
I always liked the concept of arrays. Being able to conceptually visualize in multiple dimensions took me some time to get my mind around, but in the end I was successful. The example here will discuss 2 dimensional arrays of type single, multiple and jagged. A single dimensional array is the simplest. You simply code […]
Read More →Generics
When we think about the word Generic outside of the programming world it simply means that the object is not tied to any specific kind. An example is a bank account. We may not know which bank it is associated too, if it is a checking or savings account, however we do know that we […]
Read More →Lesson 14 – SilverLight 5.0 using NHibernate 3.2 and WCF
In Lesson 14 you will learn how to: Create a SQL Server database from Visual Studio Create the database table using NHibernate SchemaExport Create a WCF which uses NHibernate Create a SilverLight 5.0 application Populate SilverLight 5.0 DataGrid
Read More →Lesson 13 – NHibernate Mapping by Code, SchemaExport and SchemaValidate
In Lesson 13 you will learn how to: Install and reference NHibernate 3.2 Beta 1 Create a SQL Server 2008 database Create NHibernate entities using Mapping by Code Create a strongly-typed NHibernate configuration Use SchemaExport and SchemaValidate to create tables and relationships Insert and retrieve data
Read More →