Book review: Data Entry and Validation with C# and VB.NET Windows Forms

Book data

  • Title: Data Entry and Validation with C# and VB.NET Windows Forms
  • Author: Nick Symmonds
  • ISBN 10: 1590591089
  • ISBN 13: 978-1590591086


The book starts of with an introduction to wet your appitite on the subject by demonstrating why data entry screens can be challenging and fun to code. Then the obligatory who should and why you should read this book and what you will know after hving read this book.

Chapter one describes the .NET data entry controls. After a short definition of validation it continues with the simple data entry controls which .NET provides, like RadioButtons, GroupBoxes and ComboBoxes and how they can help to manage your screen realestate. Then the author develops a small example application to demonstrate some of the concepts in data entry and validation. He then continues with some more controls like the Button, CheckBox, RadioButtons (again), DateTimePicker and MonthCalendar, ToolBar and Menu, TreeView and ListView and finally Data-Bound controls. This last topic is expanded in an example application.

Chapter two discusses UI design considerations for data entry. It starts of with some valueable guidelines for screenlayout in data entry screens by discussing a good and bad layout example. After that the chapter continues with the implementation of a complete data-entry form:

  • Screen layout
  • Use of menu’s and toolbars
  • Form setup
  • Steering the user by enabling and disabling entry controls

After this example he shows an alternative to GUI screens: console applications.
He closes the chapter by further discussing your screen management options, like screen resolution and resizing, control resizing and ambient properties.

I found these first two chapters very promissing for the rest of the book. There is some good advice on how to layout your forms. But then the quality of the book really goes down.

Chapter three then handles about Data Presentation Screen Issues. It discusses Single Document Interfaces (SDI), Multiform SDI (you know, like Office Word) and Multiple Document Interfaces and provides sample implementations of these. The next subject of this chapter is internationalization and discusses designing your forms for multiple languages, text resource files, XML resource files and binary resource files, displaying time, dates and currency and numbers. He then finishes the subject by providing again a complete example. The last subject of this chapter is about Accessibility

The next chapter, chapter four, is about the keyboard and mouse-handling. It starts with discussing the Key events KeyDown, KeyPress and KeyUp and provides a sample application to experiment with them. The mouse events are treated by using a sample application.

These two chapters do not give you any real value. They demonstrate how to implement some features but do not really provide any advice on how and when to use them.

Chapter five is about the Object Oriented GUI. It discusses how to handle the GUI in an object oriented fashion. It demonstrates some concepts using some rather complex form with a treeview and a listview. I will not go into discussing this chapter any further because I think it does not add any real value: it is simple a thourough discussion of the treeview and listview control. In doing this, the writer develops a form with those controls and a context menu in what he calls an object oriented fashion. Unfortunatly, his design is broke: there is no seperation of his business code and his GUI code and he mixes the context menu code in his business object. Oh yeah, the chapter finishes discussing anchoring and docking of controls.

Chapter six then, is about Advanced Data Entry. It starts with a rather short introduction to the basics of ADO.NET, so to be able to discuss the next control: the DataGrid control. What follows again is a thourough discussion of the DataGrid control by developinig a small sample application. After this the writer discusses other data sources like RS 232 data. It’s just a simple excuse to show the use of an OCX in .NET. Next he discusses file based data. This is where I started to get really disappointed in the book: instead of providing advice on reading data from files and validating it and discussing versioning of files with respect to validation, he simply shows how to write some data to a file and how to read some data from a file. He ends the chapter with a .NET implementation of a c++ like union datatype.

Next is chapter seven about error handling. It starts with an introduction to the ErrorProvider control and discusses to pro’s and con’s of this control. Then the writer proceeds with the Error dialog box and gives some advice on errormessages, things everybody knows: make them clear, give your user the chance to get around it gracefully, etc…
Next is a discussion of alternative ways to show errors or events that happened in your program: the Event Logger and TraceListeners. This is again done by using some simple example code.
The chapter finishes with a rather disappointing discussion of error handling: the basic try-catch-finally construct. Nothing special here like advice on how to implement exceptions, how to use inner exceptions, etc…

Chapter eight discusses Advanced Validation and Custom Data Validation controls. It starts with a discussion of Regular Expressions and then discusses the Masked Edit control is provided by an OCX with Visual Basic 6.0 just to conclude it doesn’t work. Fortunately, he goes on with the implementation of a custom masked edit control and a test application for this control. He then continues with an alternative implementation, using the IExtenderProvider interface and again develops a testing application and finishes the chapter with a Regular Expression Validator control. I found these controls very interesting and the discusion of their implementation is very thourough.

Next is XML Data Entry and Validation in chapter nine. It sets off with a warning about XML: it is a text format that is human readable. It then shows an example on how to write to an XML file and how to use encryption to hide a password written to an XML file. Unfortunately, this part of the code isn’t any good, as the author warns you himself. Only, he doesn’t show how to do it right as one would expect in a book about data validation.
Next, he etends the application with reading an XML file and validating the data.
Then he shows a sample application using a validating XML reader: how to construct the XML Schema and following the application: writing and reading using an XML schema.

The last to one chapter, chapter ten, is about keeping your users happy. It gives an impressive discussion on how to speed up the treeview control by optimizing node construction, postponing node construction (like used in the Windows Explorer treeview for your foldestructure and using multithreading.

The last chapter then shows a complete application. Unfortunately, the author conludes at the end of the chapther “Although the Golf project is by no means a complete project, it is complete enough to show you how everything in this book ties together.” I would have liked a complete project.


Is this a bad book? No. Is it a good book? No.

If you are not allready familiar with Winfows Forms, I’m sure you will get some value from this book. But then there are other books available which will give you more insight into the subject.

The author fills pages with code, by showing all the code of an application instead of just the important bits. And as if this is not enough, he shows the C# and the VB.NET version of each application. You can imagine this really fills the book without providing any real information to the reader.

He also keeps comparing Visual Basic with VB.NET, with at it’s peak a complete explanation of an application using the masked edit control just to conclude it doesn’t work. He’s excuse being that he wants you to feel what he had to go through to get at this conclusion. I would have taken his word for it.

There is also no real guidance, appart from a few pages about how to group controls on a form. I’m sure, if you look on the internet you will find much more valueable advice on GUI design.

This book was a real disapointment: a very interesting subject got handled in a superficial way. In doing that, the author isn’t able to teach you any real value and his book can be replaced with a more thourough book on windows forms and a book on GUI design.


3 thoughts on “Book review: Data Entry and Validation with C# and VB.NET Windows Forms

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s