January 28, 2009

Add an AutoIncrement Column to a DataTable

Adding an AutoIncrement column to a DataTable is quite simple: When you create a DataColumn, set its AutoIncrement property to true. The following code demonstrates: DataColumn posId = table.Columns.Add(“PositionId”, typeof(int));posId.AutoIncrement = true;

Adding Custom Attributes to HTML Elements

A custom attribute is any user-defined attribute, just like other primitive HTML element attributes. You can add custom attributes to any HTML element. For example, suppose you wanted to add the displayName attribute to the following HTML text box: &ltinput type=”text” id=”txtBox” /&gt There are two ways to do this:

Associate a ServerSocket with a ServerSocketChannel in an NIO App

This tip shows you how to create a ServerSocketChannel, to which you’ll then associate a standard ServerSocket: //create the ServerSocketChanneltry{ serverNIO=ServerSocketChannel.open(); serverNIO.configureBlocking(false); }catch(IOException e) {System.out.println(” Error: ” + e.getMessage());}//indicate the host and the porttry{ InetAddress addr=InetAddress.getByName(“localhost”); ISA=new InetSocketAddress(addr,port); }catch(UnknownHostException e) {System.out.println(” Error: ” + e.getMessage());}//connect a ServerSocket to a ServerSocketChanneltry{

Reliable Sessions Made Simple with WCF

he ACME Toothpick Company recently implemented two transactional Windows Communication Foundation (WCF) services to integrate their toothpick manufacturing and log inventory applications. A third application, the ACME Manufacturing Manager (AMM), was subsequently developed to utilize the new services and manage the overall manufacturing process. The project was a resounding success

10 Tips for Writing Consistently Popular Programming Articles

For authors, it’s a sad fact that when it comes to popularity, not all articles are created equal; some prove to be more popular than others. The truth is that no matter how well you select topics, or how well you write, you won’t be able to hit a home