Application #53. Working with Console Applications

This sample application shows you how to create and use a console application. The application uses Microsoft SQL Server to read the Northwind database Products table into a dataset. When the application is run, it can accept a command-line argument or input from the user, which is either a Product ID or QUIT.

If a valid Product ID (integer format) is entered, its associated product information is displayed. If an invalid Product ID is entered, an exception message is displayed. You can continue to input Product IDs as long as you care to. When you type QUIT and press Enter, the application ends.

Building Upon...

Application #1: Use Arrays

Application #3: String Manipulation

Application #12 ...

Get 101 Microsoft® Visual Basic® .NET Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.