I often get email complaining that VB.NET isn't as easy as Visual Basic used to be for simple file access. I also get email asking how to process an Access database or an Excel spreadsheet where it seems that the only reason Access or Excel is being used is to stay with known, familiar tools.
There's no question that VB.NET is a complex tool. It has to be to provide all of the choices and possibilities for creating great systems. But sequential file access is still very much a part of VB.NET and there are more choices now to do it than ever. I even wrote an article summarizing the choices available: Simple File Processing and VB.NET
But, let's face it ... sequential file access, Access databases or Excel just isn't the best way to do data. Usually, the best way is to use a real database - even if it's just one table. A single table database is nearly the same as a sequential file anyway except that you get all the programming tools for a real database. The goal of this article is to show you that you can use a real database using free Microsoft tools rather than sequential files. I'll admit that the 'startup' time to learn the tools is longer and you do have to download and install the database software, but after that, you're home free.
Plus, you can learn how the new SQL Server Compact 3.5 database files work and move up to more complex and sophisticated programming by starting small this way.
A lot of the world's industrial databases are Microsoft SQL Server databases. There's no question that SQL Server has earned its place at the top, just as .NET has. But just as there is a free, totally compatible and downloadable version of Visual Studio for programming (Visual Basic .NET Express Edition), there is also a free, totally compatible and downloadable version of SQL Server, also called the Express Edition.
This article will use these free tools exclusively!
To become familiar with SQL Server Express Edition, let's look at some of the features built into VB.NET Express.
- Database Explorer
Click on the View menu in VB.NET Express to open the Database Explorer window. This is a hierarchical view (like Solution Explorer) of the databases your application has connections for and all the things that are in them. - Database Tools
Click on Tools > Options... and then make sure the Show all settings checkbox is selected. Database Tools lets you select settings like the timeout value for transactions, the default query, and the default length of columns (like char and binary columns) that will be used.--------
Click Here to display the illustration
Click the Back button on your browser to return
-------- - The Connect to Database... wizard
This wizard located under Tools walks you through a database connection for SQL Server and other popular databases. It's also available using an icon in Database Explorer.
On the next page, we learn how to create and use the free tool we'll use, SQL Server Express.

