Using Databases with VB 2005 Express
One of the great things about Visual Basic 2005 Express Edition is its tight integration with Microsoft SQL Server 2005 Express Edition, which is the free cut-down version of Microsoft's database program. When you install VB 2005 Express, it asks whether you would also like to install SQL Server 2005 Express. I think it's well worth the extra download, because it adds advanced database capabilities to VB 2005.
There are graphical tools to help you design a database, creating the required tables and the columns within the tables. If you were making a database of your DVD collection, the columns might be Title, Year, Director and so forth. You then have to connect the database to your VB 2005 project. Then you create a way to view and edit the database using your application. This is ridiculously easy, you simply have to drag and drop the columns onto your application's form. They appear on the form as TextBoxes with Labels already filled in for you, or you choose from other options such as ListBoxes. Visual Studio automatically adds a navigation strip that lets you move between records in the database so you can find and edit information, add and delete records. You can create a minimal database application like this in about 5 minutes, just by dragging and dropping. Instead of this, you can use a DataGridView that shows you the information like a spreadsheet.
You work with databases through datasets. A dataset is basically your local copy of database information. It could hold all of the information in a database, or just a part. You can change the dataset and then save the changes back to the database. You can write Fill functions to fill the dataset. For example you might write a FillByYear function to fill the dataset with DVDs from a certain year. If you were using a large database, you would want to fill the dataset with only the data you were interested in, rather than trying to deal with the whole database.
I learned a lot about databases using VB 2005 Express. As the database I was using was SQL Server 2005 Express, I learned the basics of SQL (Structured Query Language). This lets you find information in a database by asking the database to return only the data you are interested in, rather than trying to read through all of the data yourself. For example if you wanted to find movies by a certain director you might use a query like:
SELECT title, year FROM MyDVDs WHERE (director = @Dir)
where you have set the Dir variable to the name of the director you're looking for. You don't have to use SQL Server, as VB 2005 can also connect to other databases such as Microsoft Access or MySQL.
Being able to use a proper database is a great strength of VB 2005. Databases are hugely powerful compared to storing data in simple text files. There is a bit of a learning curve when you start using a proper database like SQL Server, though. If you do choose to use a database, it's well worth learning the basics from a good book or tutorial so you don't have any bad habits right from the start.
Next, my conclusions.