Adding a Data Source to the Form

Create a new Data Source based on a database. You’ll need to add a new connection too. Since you installed dotConnect, SQLite should appear as an option when you add the new connection. Locate and select the database TheBooks.db. Save the connection as TheBooksConnectionString, if you’d like. Then select the Clients tables and call the…

Continue reading Adding a Data Source to the Form

Copying a Form

You know, that was a pretty cool form we made. The DGV can display rows from a table, and the sidebar on the left can have buttons and links. It seems like it could be used in different places. Can we keep it and just use a copy? In C#, you can base a form…

Continue reading Copying a Form

Our First Form

There should already be a Form1 in your project, created automatically by Visual Studio when you created the WinForms projects. There’s nothing in the form, and before putting things in it, we’re going to set a few properties on the form itself. First, size the form to something like 800 x 600. Then, set the…

Continue reading Our First Form

Creating the Project

We have enough of a database to get started, so fire up Visual Studio and create a new Windows Forms App under Visual C#. What should we call it? I know! QuickBooks. Oh, wait… that’s taken. FastBooks? SpeedyBooks? I wound up calling it just plain TheBooks. My project now looks like this: This is all…

Continue reading Creating the Project

A Date with SQLite

Now let’s use SQLiteStudio to add a table called Invoices, like this. Note that SQLite doesn’t actually have a date type. Instead, you use SQLite’s date functions to convert back and forth to string or numeric types. If you store dates as strings in TEXT fields, SQLite uses ISO format, which makes the date easily…

Continue reading A Date with SQLite

Our First Table

Using SQLiteStudio, add a database called TheBooks (no space) and add a table called Clients. Configure the table like this: CREATE TABLE Clients ( ID INTEGER PRIMARY KEY, Name VARCHAR (32) NOT NULL, Address1 VARCHAR (32) NOT NULL, Address2 VARCHAR (32), Address3 VARCHAR (32), Address4 VARCHAR (32), Contact1 VARCHAR (32), Contact2 VARCHAR (32), Contact3 VARCHAR…

Continue reading Our First Table

Setting up SQLite

Setting up SQLite turned out to be a lot easier than I thought, though I first went through a lot of false starts. I downloaded Microsoft’s System.Data.SQLite, but I couldn’t create DataSets in Designer. I installed and uninstalled a lot of things, but finally, it seemed the only thing I needed was a driver, just…

Continue reading Setting up SQLite

Choosing Our Database

As you know, the database world is divided into SQL databases and other SQL databases. That’s only a slight exaggeration. Even Microsoft Access understands SQL. There are two broad kinds of SQL: server-based and client-based. Server-based SQL is software that runs on a server. You send the server an SQL query, and the server returns…

Continue reading Choosing Our Database