Csharp Database Programming

Project-based Learning: how to use C# Windows Forms and Microsoft Access Database to create small database driven apps

Last updated 2022-01-10 | 4.7

- Students will understand the basics of database programming using C# and MS Access database.
- Students will become familiar with database programming concepts.
- Students will be able to create small database-driven desktop apps.

What you'll learn

Students will understand the basics of database programming using C# and MS Access database.
Students will become familiar with database programming concepts.
Students will be able to create small database-driven desktop apps.
Students will understand basics of database concepts.
Students will be able to create and modify Windows Forms and bind form objects with database objects.
Students will be ready to tackle more complex projects.

* Requirements

* Visual Studio
* Basic familiarity with Windows Forms
* Basic C# Skills (loops
* conditional statements
* very basics of OOP etc.)
* Basic knowledge of Database terminology

Description

WARNING!  Some students reported that the MS Access database used in this course will not work with the current version MS Office 365, even with legacy MS Access database redistributable engine. In majority of cases the issue is solved by installing 2016 version of the MS Access database redistributable engine (please see Q&A section of the course). If this doesn't work for you and you experience problems after purchasing the course, please note that Udemy offers 30-day money back guarantee.

I created this course with a C# beginner in mind. Someone, who knows the basic C# concepts, and knows his way around loops, conditional statements, arrays, and very basics of object oriented programming, but never really had a chance to incorporate any of it with a relational Database project. If that describes you, then this is definitely a course for you.

For this course, I decided to use a Microsoft Access database, as that is a common database small business use around the world. Now, full disclosure: we won't be creating any earth shattering application and there will be a lot of room for improving our code. What we ARE going to be doing is LEARNING how to use with C# with MS Access, and we'll use a simple, but fairly common scenario - a small books database app.

The goal of this course is three fold

  • First, is to show you how things work

  • Second, help you understand how things work under the hood.

  • And third, to drill the basics so that they become a second nature to you.

This course concentrates solely on using Access database with C 

We will use Windows Forms as the user Interface and we'll use form events to code the application logic to. This way, we won't get distracted with million other little things that come into play for truly well designed commercial app. Like I said, the goal here is to LEARN the basics, and to RETAIN the knowledge. 

From my own experience, from the beginners point of view, nothing is worse than taking a course to learn the basics, only to suddenly be introduced to a dozens of advanced real world concepts, that completely derail you from learning what you came here to learn in the first place...which is, the basics. What good is it for a beginner to watch someone build professional grade app when three quarter of the stuff presented goes right over your head? Not in this course. 

However, with that being said, if you go through this course, and if you code along, I am absolutely sure that at the end, you will have great foundation to build on, and you will be able to move to more sofisticated applications and coding styles.

The course consists of several sections. The first few sections introduce the basic concepts, such connecting to database, browsing through the records, binding database fields with form objects in the windows forms and other core concepts related to databases as well as windows forms.

First project is a small Data Entry application. This project does not include database yet. We will create a simple data entry form and explore few properties and form objects. This project serves as a simple introduction or a refresher, and if you are familiar with basics of windows forms and the concept of properties and events, then you can safely skip this project. However, there still may be a few things you could learn from this project, as we will be working with timer, key press events, mouse events, and form elements in the run time.

Second project will be a mix of theory and practice. We'll spend a few minutes going through some basic theory where we will discuss some basic database concepts, SQL commands, and C# database objects and after each lesson, I will demonstrate a practical use of each of the concepts. 

In our third project, we start putting the theory into practical use. It'll be just a simple project that loads data into our form from one table, but we will see in action how to connect to the database and how to select records from the table. Ir will also be a little departure from previous examples, as we will use a different database.

Fourth project is na SQL tester. Here, we will be able to test SQL commands. We'll use all the knowledge we acquired thus far, and introduce some cool techniques in the Windows Forms allowing us to create form elements at run time. And, we will have a small, but functional practice environment for SQL commands.

Fifth project is the last, and most comprehensive one. We will create a small books database app. Until this project, we were only displaying records, but now, we will learn to add new records, edit or delete existing records, we will work with multiple forms and tables, put in place an application state for different actions - such as enable and disable controls based on user's action, and also learn how to pass data from one form to another.

This whole course is designed as follow along course. Meaning, you are encouraged to code along with me. Everything is on the video, there are no code snippets being magically pasted into the Visual Studio. Also, I don not want you to just learn the concepts and then forget them a week later. I want you to remember and retain what you learn in this course. 

And let's face it - that is only possible when you not only work on the project along with me, but also try to do the exercises. Trying to solve problems on your own is at the core of learning to program. However, I won't just leave you figure things on your own, I am well aware that sometimes it may feel overwhelming. So I will also show you my solutions. 

And one more thing that makes or breaks learning to program - using what you learn, and using it frequently. Therefore, I code even the repetitive things from scratch and I don't simply just refer you to previous lessons. But that means, that if you just watch the course, it will feel repetitive. However, if you actually code along, I guarantee you will feel like you learn, and also REMEMBER what you learned

But, If you prefer more instructional videos, that show everything once and move faster, then this course is not for you. Please keep that in mind before purchasing the course. I encourage you to watch some of the sample videos so you get a feel for the course structure and my teaching style.

Now, I made the videos short and to the point. Most videos are only around 5 minutes long. That is deliberate, so each video is a small learning step that is easy to follow.

Alright, there's a lot of coding to be done. So let's get to it!

Who this course is for:

  • Beginner C# developer who wants to create small database driven Windows Forms apps
  • Selft Taught programmers or students interested in C# and databases
  • Anyone seeking to get entry level position or internship,
  • Students who like to learn by hands-on examples.

Course content

9 sections • 153 lectures

Project Intro Preview 01:17

Building The Form Part 1 Preview 07:25

Building the Form Part 2 Preview 05:20

Clearing and Exiting the Form Preview 02:37

Adding the Timer Preview 03:44

Timer Tick Event Preview 06:43

Start Button Event Preview 04:17

Pause Button Event Preview 02:24

Data Entry Section Preview 10:23

Setting Up KeyPress Event Preview 03:11

KeyPress Event Part 1 Preview 07:50

KeyPress Event Part 2 Preview 05:37

Mouse Events Preview 05:09

EXERCISE - Add Mouse Event for Multiple Buttons Preview 05:20

Initializing Component Method Preview 02:33

Database Theory Part 1 Preview 03:56

Database Theory Part 2 Preview 06:59

Overview Of C# Database Objects Preview 01:58

Connection String Overview Preview 01:34

Connection String Example Preview 08:18

Command And Data Adapter Overview Preview 01:26

DataTable Overview Preview 02:10

Command Object Example Preview 02:56

Data Adapter Example Preview 03:36

DataTable Example Preview 02:17

Data Binding Overview Preview 01:01

Data Binding Exercise Preview 06:46

CurrencyManager Overview Preview 00:38

CurrencyManager Example Preview 08:04

Using Wizard to connect to DB and bind form objects Preview 06:28

EXERCISE - USING C# DATABASE OBJECTS (NorthWind Database) - INSTRUCTIONS Preview 01:10

EXERCISE - NorthWind - Creating the Form Preview 05:30

EXERCISE - NorthWind - Adding Database Objects Preview 05:00

EXERCISE - NorthWind - Data Binding Preview 04:09

EXERCISE - NorthWind - Currency Manager Preview 03:50

Intro Preview 02:08

Creating the Form Preview 04:19

Connecting to Database Preview 02:53

C# Database Objects Preview 08:15

Running the Program Preview 12:27

Intro Preview 01:50

Creating the form Preview 02:05

Creating Buttons Programmatically Part 1 Preview 05:20

Creating Buttons Programmatically Part 2 Preview 10:27

Connection String and SQL Query Command Preview 07:00

Finishing SQL Query Command Preview 06:49

Database Objects Preview 03:10

Running the Program Preview 01:09

Intro Preview 03:17

Authors - Creating the Form Preview 05:33

Authors - Adding Database Objects Preview 07:11

Authors - Navigating Between Records Preview 03:50

Authors - Setting up Save and Delete Events Preview 04:36

Authors - Application States Intro Preview 02:04

Authors - Coding Application States Preview 06:23

Authors - Working with Application States Preview 06:50

Authors - Validating Input Preview 06:23

Authors - More Input Validation Preview 07:13

Authors - KeyPress Event Preview 05:27

Authors - Error Handling Preview 06:54

EXERCISE - PUBLISHERS - INSTRUCTIONS Preview 02:05

EXERCISE - Publishers - Creating the Form Preview 07:51

EXERCISE - Publishers - Adding Database Objects Preview 04:43

EXERCISE - Publishers - Data Binding and CurrencyManager Preview 07:41

EXERCISE - Publishers - Application States Preview 07:12

EXERCISE - Publishers - Input Validation Preview 09:18

EXERCISE - Publishers - Navigating Through Records Preview 09:45

Authors - Saving Records Preview 05:27

Authors - Bug Fix - Saving Record Preview 12:03

Authors - Deleting Records Preview 05:50

Authors - Adding New Records Preview 02:51

Authors - Adding New Records - Changing Application State Preview 06:05

Authors - Adding New Records - Record Position Preview 05:39

Authors - Final Adjustments Preview 02:58

EXERCISE - PUBLISHERS - CRUD OPERATIONS - INSTRUCTIONS Preview 02:03

EXERCISE - Publishers - Adding Record Navigation Preview 02:05

EXERCISE - Publishers - Saving Records Preview 05:38

EXERCISE - Publishers - Saving Records (testing) Preview 04:40

EXERCISE - Publishers - Adding and Deleting Records Preview 04:02

EXERCISE - Publishers - Changing Application States Preview 03:26

Publishers - Adding Search Functionality to the Form Preview 02:48

Publishers - Coding Search Functionality Preview 09:20

EXERCISE - AUTHORS - ADDING SEARCH FUNCTIONALITY - INSTRUCTIONS Preview 00:28

EXERCISE - Authors - Adding Seach To The Form Preview 02:16

EXERCISE - Authors - Coding Search Functionality Preview 09:18

Authors - Bug Fix - Edit and Cancel Events Preview 02:36

Authors - Bug Fix - Add New Record Preview 06:57

Publishers - Bug Fix - Cancel Adding New Record Preview 04:36

Titles - Introduction Preview 02:19

Titles - Creating the Form Preview 06:30

Titles - Adding C# Database Objects Preview 10:50

Titles - Navigating Between Records Preview 06:29

Titles - Application State Preview 07:58

Titles - Input Validation Preview 08:29

Titles - Application State For Edit and Add New Record Preview 02:35

Titles - Saving Edited Record Preview 11:00

Titles - Deleting Records Preview 04:14

Titles - Cancelling CRUD operation Preview 05:24

Titles - Bug Fix - Not Allowing Letters for Year Published Field Preview 02:58

Titles - Adding Authors and Publishers to the Form Preview 05:01

Titles - Authors Database Objects Preview 03:28

Titles - Loading Authors Database Objects Preview 06:35

Titles - Getting Authors for Specific ISBN - Part 1 Preview 06:32

Titles - Getting Authors for Specific ISBN - Part 2 Preview 04:01

Titles - Removing Authors From ComboBox Preview 04:47

Titles - Application State for Authors Preview 01:49

Titles - Saving Authors And ISBN Preview 12:26

Titles - Updating Authors Search Functionality Preview 01:19

EXERCISE - TITLES - ADD PUBLISHERS TO THE FORM - INSTRUCTIONS Preview 03:02

EXERCISE - Titles - Adding Publishers Database Objects Preview 09:45

Titles - Adding Connection to Authors Form Preview 07:45

EXERCISE - TITLES - ADDING CONNECTION TO PUBLISHERS FORM - INSTRUCTIONS Preview 00:50

EXERCISE - Titles - Adding Connection to Publishers Form Preview 06:48

Titles - Testing Adding New Records Preview 02:13

Titles - Debugging Preview 11:17

Passing Data Between Two Forms - Improving Search Preview 06:19

Passing Data Between Two Forms - Improving Search for Titles Preview 07:31

Passing Data Between Two Forms - Improving Search For Authors and Publishers Preview 04:55

Adding Print Event Preview 04:21

Setting Up Page Header Preview 08:51

Printing Title and Authors Preview 09:32

Printing The Rest of the Fields and Testing Preview 04:46

Project Introduction Preview 04:41

Reviewing the Database Preview 01:17

Reviewing the Forms Preview 01:42

Connection String Preview 01:49

Passenger Class Preview 02:15

Seat Class Preview 03:35

Checking If Plane is Full Preview 05:05

Checking if Seat is Taken Preview 06:54

Outline of Methods and Events We Need Preview 07:25

Creating Objects Preview 02:24

Displaying Seating Chart Preview 12:46

Populating DropDown Rows From the Database Preview 03:16

Validate Input Part 1 Preview 05:30

Validate Input Part 2 Preview 10:50

Testing Validation Preview 05:09

Inserting Passenger Preview 08:51

Testing Adding a Passenger Preview 03:00

Show All Passengers SQL Command Preview 13:03

Search For a Passenger SQL Command Preview 04:03

Pass And Load Data Between Forms Preview 05:07

DataGridView Click Event Preview 06:26

Edit and Delete Passenger - Outline of Things To Do Preview 04:29

Data Binding Preview 11:08

Validating Waiting List and Seat Information Preview 03:33

Editing Record Preview 07:23

Updating Passenger and Seat Records Preview 07:19

Testing Edit Functionality Preview 06:41

Delete Passenger and Final Test Preview 11:09

Conclusion - Summary of what we learned, where we are, and where to go from here Preview 02:01

Bonus Lecture Preview 00:35