web 2.0

Locking Resources at Dinner

One of my students, Jenny :), showed me a story the used a dinner illustration to deal with locking.  Not only was it funny but it was right on and helped to explain in a different way what resource locking is.  This repost is from Mike Taylor's blog called the Reinvigorated Programmer located at http://reprog.wordpress.com. More...

Tags: ,

.NET

Jumpy Message Box - April Fools, 2010

For April Fools day I created a program that created a small message box containing an error message on the screen.  When the computer user tried to click on the OK button the message box jumped to a different area of the screen.  The only way to close the box is to hit the space bar when the form is active (has focus).  The code used to create this little program detects the bounds of the screen to make sure the box stays within the viewable area, random number generation to get new location coordinates as well as using the Top and Left properties to move the form around the screen.  More...

Using Connection Strings From the web.config File

Storing your connection strings in the web.config file has several benefits over hardcoding it into your application.  First of all the web.config file (or just the connectionStrings section) can be encrypted to help keep your database connections secure.  Also if the connection string would ever change you can update your connection string in the web.config file without having to recompile your application.  However, using the web.config file tends to be a mystical thing for most beginning .NET programmers so we are going to try to demystify this powerful tool.  More...

Stub Project - Login User Control: Part 2

This is a two part project to create an advanced login user control.  In part 1 you created the login form with input validation checking.  In part two you will take that form and convert it to a user control and test it on a new windows application project. More...

Tags: , ,

.NET | C# | Stub Projects

Stub Project - Login User Control: Part 1

This is a two part project to create an advanced login user control.  The first part is to create the login form with input validation checking. More...

Tags: , ,

.NET | C# | Stub Projects

Development Practice with Stub Projects

Stub projects are small sample projects with minimum direction to help challenge and enhance your development skills.  Each project contains a working example, a complete solution file as well as a starter file that contains only the comments necessary to guide you in your development.  Each zip file also contains an .doc file describing the output objectives of the project.  You can use these projects as practice by trying to create the project completely from scratch using only the objectives from the .doc file, using the starter file with the comments or by doing a code review from the solution file.  Many stub projects will be broken down into multiple parts to keep the objectives as clear and simple as possible.

Good Luck!

Tags:

.NET | C# | Stub Projects

Finding Freelance Gigs

Trying to find freelance development projects can be some what of a challenge especially if you are new to trying to find this kind of work.  Here are some suggestions as to where to look.  More...

Tags:

Freelance

Open Source Alternatives to Proprietary Software

Trying to build your software collection can be an expensive endeavor.  Especially for developers many of the different software tools that are available are very expensive and it is just not possible for individuals to flat out purchase all of the programs that they need for development such as Visual Studio, Photoshop and Camtasia Studio.  Luckily there are alternatives. More...

Tags: ,

Open Source Applications

Delegates and Events

Delegates and events can be confusing.  This project was created with numerous comments to help you navigate your way through the application and track what is being called from where.  Essentially this is an example of the publisher/subscriber model.  The event in the BankAccount object fires an event which a method has subscribed to from the Form object.  When that event is fired a delegate is used to pass the arguments to the subscribing method causing it to run and thus yielding the result.  More...

Tags: , , , ,

C# | Object Oriented

Polymorphism

Many people are confused by the concept of polymorphism.  Many other people try to explain to them the concept of polymorphism using examples of animals or other objects.  As I was teaching I found myself showing an example of polymorphism by describing an application so I decided to quickly create the application I was describing so that students could see both the code and the functionality using concepts that they were familiar with (Bank Accounts: Saving and Checking Accounts).  Below you will find my code, explanations and the Visual Studio 2005 project that you can download. More...

Tags: , , ,

C# | Object Oriented

Choosing Web Hosting (and Domain) Providers

I have had a number of students ask me where I host and which domain name provider I use. Why do I use them? What do I look for in selecting the providers that I use? Well... Let me tell you. More...

Tags: , , ,

Visual Studio | Product & Service Endorsements

Don't Reinvent the Wheel

So you have landed that big programming gig or find yourself at your new web development job and you are handed a project that requires a bunch of custom controls.  You know that you don't have time (or want to take the time) to create all of these controls yourself so what do you do?  More...

Tags: , ,

.NET | ASP.NET

Dropping All Tables in a SQL Server Database

I ran into a situation using an auto install application that creates a large number of database tables for me the errored.  I wanted to run the installer again but it was taking forever to delete the large number of tables that were created in the database since I did not have SQL Management Studio access and was doing it via a web based interface.  I searched and found a simple way to delete all tables from a SQL Server database.  More...

Tags:

SQL Server

Portable C# Development Environment

I have recently began using a portable application suite called the Lupo Pen Suite (http://www.lupopensuite.com).  It is a free application launcher the runs portable versions of many popular programs simply off of a pen drive.  It comes with a large number of programs to begin with however I wanted a portable C# development environment.  I began looking and found the answer. More...

Tags:

C#

Dropping Constraints on All Tables in a MS SQL Database

I have run into times that I want to delete all the tables out of a database without dropping the database and recreating it.  One example is in working with a prebuilt system such as DotNetNuke or Mango Blog in which the web application has an installer wizard built in that runs and creates all the tables needed for that application.  If something goes wrong during the initial run (not that anything in technology ever goes wrong) I may need to re-run the wizard but will run into problems if the tables that were created during the first try are still present.  In this case I want to delete all the tables that were created and start from scratch.  The problem comes in if there are constraints on those tables that won't allow you to delete all the tables (this is the situation I ran into with a DotNetNuke install).  So then what do you do? More...

Tags:

SQL Server

Making Web Applications Play Well Together Under the Same Hosting Account

There are a number of free open source web applications that you can use.  A couple of these are BlogEngine.net which is a .NET blog just like it sounds.  Another is Dot Net Nuke which is the most popular open source content managemet system for .NET.  These applications have very easy install and set up but getting them to play well together can be a different story (unless you know how to make them get along!) More...

Tags:

Open Source Applications | BlogEngine.NET | Dot Net Nuke

Static Classes and Members in C#

Classes are blue prints for objects.  We create classes and then instanciate those classes to create instance objects which can each contain different data and interact independently of each other.  So what are static classes and why would you use them?  More...

Tags:

C#

Comparing Versions of the .NET Framework and Visual Studio

I recently received two related questions from two different people and figured it might be a common question.  One question was about the versions of the .NET framework and the other was about versions of Visual Studio.  While one is a programming framework and the other is a programming tool they are actully connected. 

The first question was asked by one of my students, "Do programming languages come out in versions like software?  For instance, is C# 3.0 the same as, or is it, what we are working with to write programs?".  We essentially were using the 2.0 framework and I'll explain more about that in just a minute.  The second question came from my manager when he asked, "In writing a resume (something we assist students with) do we need to state that they know .NET or do we need to specify which version.  And how does Visual Studio tie into those?" More...

Tags:

.NET

Creating ASP.NET Tables in Sample Databases

In the last post I discussed installing the sample Microsoft database for use with a number of examples as well as with your own experimentation.  One of the key features of ASP.NET is the Membership, Roles and Profile features that are built into the language.  However, to use these features you need to create some specific tables in your database(s).  In a previous post I provided a SQL script that would create the Membership tables however it did not provide for all the tables needed for all the available functionality.  In this post I am going to show you how to use the aspnet_regsql.exe tool to create those tables on your local SQL Server instance and then provide you with the complete SQL script for use in shared hosting environments and other locations that you don't have permissions to run the aspnet_regsql.exe tool. More...

Tags:

ASP.NET | SQL Server

Downloading and Installing Sample Microsoft Databases

There are numerous books and articles that reference different Microsoft databases including Northwinds, Pubs and Adventureworks.  In order to simulate the examples from these writings as well as to have a populated database that you yourself can write code against in order to play and experiment with new code it would be nice to have these installed into your local SQL Server.  This post shows you where to get the databases that you need and gives you some pointers on getting them installed into SQL Server 2005.  More...

Tags:

SQL Server

Generating Random Numbers in C#

One very common question I get from students is how to generate a random number using C#.  This is very easily done using the Random class.  More...

Tags:

C#

Creating and Using a C# Class Library

A class library is a set of classes, interfaces, and value types that are included in a seperate project from your main forms application.  This library provides access to specific functionality that can be used and updated independantly from the main application.  The class library is compiled as a seperate .dll that is referenced from your application.  Lets take a look at creating and using a class library.  More...

Tags:

C#

.NET String.Format Method

There is are a number of different ways to assemble a string in the .NET Framework.  One is to simply use concatination to put the pieces together.  This however can lead to long and very difficult to read sections of code.  Conversely we can use the Format method of the String object to not only concatinate variable values with literal text but also to format those values in a much easier to read fashion. More...

Tags:

.NET

Passing an Object from One .NET Form to Another

Objects are very useful to pass a group of information around from one place to another however the code can be a little mystifying if you are just starting out.  The code to pass and receive an object is as follows. More...

Tags:

.NET

Using Values from the Selected Row in a .NET DataGridView Control

When using a DataGridView control in .NET it can be very useful to access the individual values from the currently selected row.  The way to access these values however is a rather long and convoluted string.  Once you know the string you can gain access to any values. More...

Tags:

.NET

ASP.NET Membership and Role Providers on Shared Hosting

ASP.NET provides some powerful mechanisms to easily work with and implements membership and role based security on your websites. These controls however implementspecial tables that are typically created on your MS SQL Server through the use of the command line. For individuals on shared hosting accounts it is not possible to install the tables in this manner. Instead you can install them using this sql script. More...

Tags:

ASP.NET

Changing the Default Form within a Visual Studio Project

When creating applications in Visual Studio you may create several various forms each of which will be eventually linked together through a common interface however before that interface is created you may want or need to test of of these various forms individually.  To do this you need to configure one perticular file in your Visual Studio project. More...

Tags:

Object Oriented

Programming Hierarchy

When student begin studying any of the more object oriented languages including .NET, Java, etc. the concept of namespaces, classes, events and all kinds of other new terms can be quite intimidating.  Breaking these new concepts down and observing how they relate to each other can eleviate much of the initial confusion.  To begin to understand all of object oriented components let take a look at the top three and how they relate to each other. More...

Tags:

.NET | Object Oriented

Using SQL Aggregate Functions

Server-side programming languages can do a lot of things that can also be done in SQL however not as efficiently.  When site data grows larger and larger the ability for server side languages to process these huge requests decreases.  In the case of ColdFusion the server will timeout if a request takes to long.  This is where using the abilitys of the SQL server that you are using come into play. More...

Tags:

SQL

SQL Case Statements

Switch-case statements are very powerful components in any language and there is no difference in SQL.  Let’s use the sample table to take a look how to use case statements in T-SQL. More...

Tags:

SQL

Finding SQL Server Express 2005 Port Number

Finding SQL Server Express 2005 Port Number in order to set up a new ColdFusion datasource can be tricky because unlike MySQL it does not always use the same one. A number of websites and forum posts have you looking at log files and doing all kinds of strange things. There is a much simpler way to find the port number. More...

Tags:

SQL Server

Load Page in iFrame from Dropdown Menu

I was working on a website that had a number of job positions that needed to be displayed but we had limited space.  I decided to populate a dropdown list with a listing of all of the job positions and then when the user selected a position that description would appear in an iframe just below the dropdown. More...

Tags:

Javascript | HTML

Data Alignment without Embeded Tables

I recently was working on a project where I had several colums and rows of data that needed to be presented and with each cell I was to enter a label and value for the Min and Max fields.  The problem was the because of the stylesheet that controlled the printing was causing extra lines around the inner table that I was using to align the Min and Max labels to the left and the values to the right thus I could not use a table to handle the alignment. Thus I turned to CSS. More...

Tags:

CSS | HTML

Checking Passwords for Length and Alphanumeric Characters

Users do not always select secure passwords.  To help ensure that they are selecting secure passwords you can check their selected password for length as well as the existence of letters and numbers in ColdFusion using this code. More...

Tags:

ColdFusion