Building C# Console and Windows Forms Applications with LINQ and ADO.NET | Trevoir Williams | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Building C# Console and Windows Forms Applications with LINQ and ADO.NET

teacher avatar Trevoir Williams, Jamaican Software Engineer

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

36 Lessons (13h 12m)
    • 1. Introduction

      3:28
    • 2. Install Visual Studio 2019 Community Edition

      3:39
    • 3. Install .Net Core SDK

      1:31
    • 4. UPDATE: Visual Studio 2022 Community Edition Tour

      7:56
    • 5. Tour Of Visual Studio

      11:05
    • 6. Write a Simple Hello World Program

      15:06
    • 7. Input and Output Programs

      17:47
    • 8. C# Data Types and Conversion

      22:17
    • 9. Operators in C#

      16:39
    • 10. Condition Statements

      32:08
    • 11. Repetition Statements

      27:57
    • 12. Methods and Return Types

      26:36
    • 13. String Manipulation Functions

      21:24
    • 14. Handling Exceptions

      12:52
    • 15. Classes and Objects

      37:10
    • 16. Arrays and Lists

      34:55
    • 17. Create a Winforms Project

      25:58
    • 18. Build A Form and

      21:15
    • 19. Add Validations To Winforms Data

      34:01
    • 20. Create SQL Database

      9:36
    • 21. Connect to SQL Database

      12:53
    • 22. Executing A Select Query Using LINQ

      15:12
    • 23. Save Data Entered in the Form

      16:46
    • 24. Creating Additional Forms and Windows

      13:38
    • 25. Create an MDI Application

      16:33
    • 26. View Data In A Grid

      28:32
    • 27. Managing Database Changes

      18:23
    • 28. Create and Edit Vehicles

      47:45
    • 29. Vehicle Data Validations and Exception Handling

      7:07
    • 30. Manage Car Rental Records

      45:20
    • 31. Enhancing Application Flow and User Experience

      28:02
    • 32. Simple Login Form

      38:59
    • 33. Control Features Based on User Roles

      34:31
    • 34. User Password and Active Status Reset

      20:58
    • 35. Add New Users and Password Reset

      44:32
    • 36. Add Project to GitHub

      19:13
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

141

Students

--

Projects

About This Class

Overview

In this course, you will learn C# programming for desktop applications. This journey will have you becoming proficient in

  • Visual Studio Interface and Shortcuts

  • Data Driven Graphical User Interface Applications using Windows Forms 

  • Managing Databases with SQL Server Management Studio

  • Developing User and Roles Managed Interfaces and functions

  • Using Utility Classes for cleaner code

  • Developing Multi-Document Interface (MDI) Applications

  • Applying Object Oriented Programming with C#

  • Adding a Visual Studio Project to Source Control

These lessons assume no prior knowledge of programming or the C# language, and will have you up and running in no time.

Why Learn C# Language

C# is the most versatile programming language in .NET Framework and .NET Core. Not only can you build Windows client applications, but you can also use C# to build Web and mobile apps.

C# can be used to build:

  1. Windows client applications using Windows Forms, WPF and UWP.

  2. Web applications with ASP.NET and ASP.NET Core.

  3. Native iOS and Android mobile apps using Xamarin.

  4. Libraries, components, and console applications

  5. Cloud and Azure apps

  6. Block chain apps

  7. Not only is C# language supported and maintained by Microsoft, but it also has a strong community support. More than 5 million developers use C# language. .NET Core and C# compiler are open source and the adoption is growing in open source community.

Build A Strong Foundation in C# Programming:

  • Understand C# Syntax

  • Understand Datatypes and Variables

  • Understand Sequence, Decision and Repetition Control Structures

  • Understand String Manipulation

  • Understand Date and Time Manipulation

  • Understand Object Oriented Programming, Classes and Objects

  • Understand Visual Studio

  • Understand Debugging Techniques

  • Understand Event Driven Development

  • Develop Console Applications

  • Develop Windows Forms

  • Develop Data Driven Applications

  • Understand LINQ and Data Queries with C# Syntax

  • Setup Login and User Management Functionality

Content and Overview

This course is very beginner friendly and chock full of development tips. This huge course offers premium content, smartly broken up to highlight a set of related activities based on each module. We will also look at troubleshooting and debugging errors as we go along; implementing best practices; writing efficient logic and understanding why developers do things the way they do. Your knowledge will grow, step by step, throughout the course and you will be challenged to be the best you can be.

By the time you have finished the course you will have moved around in Visual Studio and examined logic and syntax errors so much, that it will be second nature for you when working in the .NET environment. This will put your new learned skills into practical use and impress your boss and coworkers.

The course is complete with working files hosted on GitHub, with the inclusion of some files to make it easier for you to replicate the code being demonstrated. You will be able to work alongside the author as you work through each lecture and will receive a verifiable certificate of completion upon finishing the course.

Meet Your Teacher

Teacher Profile Image

Trevoir Williams

Jamaican Software Engineer

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction: Hey, guys, I'm excited to welcome you to my new course entitled C Sharp Consul and Windows Forms Development with Link and A T or dot Net. Now that title is quite a mouthful, but I can assure you that we have quite a bit off content in store for you. This is a beginner to intermediate course, where I will take you through the basics off C sharp programming. You should be able to understand basic C sharp context. The blocks of cord, the different tokens that occur. The breezes holds me commence. Variables, collections, object oriented programming. All of those things will be imparted to in this course. I take a very beginner friendly approach. I assume you have no prior experience. Programming are developing applications and so I bring you step by step through each off the concepts. By the end of this course, you should be able to understand how to create our own Windows applications. Both console Onda graphical user interface using Windows forms. You'll also be learning a bit off database development as we will be building a data driven Windows forms application. Onda. We will learn how to use our tools like a tub on visual studio on. By the end of this course, you should be comfortable in either environment and be able to build a full enter end application. No, I want to bring you through why it's important for you to learn dotnet and see sharp Microsoft. Net is one of the most popular platforms that is used to build enterprise applications all over the world. You can get jobs basically anywhere in the world. If you're a document developer on, people will pay you well. The whole document platform, as well as allowing would see Sharp, which is the most popular language used in the Darknet platform, can be used to develop a wide range of applications for mobile devices for desktop applications. More recently, limits on dMarc also anything on Windows and also Web applications for this course will be using Visual Studio 2019. Community Edition, which is a fully featured I. D. E. I. D. Short for integrated development environment on it is very modern. It's very poor fool. You can use it to build a wide range off applications it's pre integrated with get and get hub on Did. It has some database management capabilities in it also. No, I did mention get up, and I'm just going to give you a brief introduction. Estelle, what that is it is source control that will allow us to track our changes being made. It's also a great way to back appear cold because if your machine crashes and you have a copy off your project up and get up, then it's easy to recover from that point on. Industry loves to know that you know how to use tools like get up. So I will be showing you how to use Get top, Andi. It will off course come off as a great benefit to you. Now, with all that being said, it is good if you have some database development knowledge on golf course you need an email address on Do you need the willingness to learn and grow That being said, However, if you don't really have all of that knowledge, it's fine. I take you step by step, and once again, this is a verb beginner friendly course. And if you're not a beginner but your intermediate, I'm sure you can find some value in this course. So welcome on, I'm glad to have you 2. Install Visual Studio 2019 Community Edition: in this video, you get started setting up our development environment, so we'll be installing visual studio. We can get to their upset by going to visual studio dot Microsoft dot com and then we will proceed to Don't. Lord. The community edition there is also professional Under is also enterprise, both of which they offer trial versions as you need to buy the license. But since we are individuals who are doing this for educational purposes are not for enterprise purposes, then we can proceed with 2019 Community Edition. Selecting that option triggers are don't Lord, which, when completed, we can execute the program. This launch is on installer, and it's a pretty straightforward process. It justly continua lowered toe, do some more, don't lose and checks. At the end of those checks, they will launch a screen, asks you to select the models that you wish to install, since we're doing C sharp programming for dotnet and for next top, then we need to make sure that we select dot net for desktop development So we just take that box. If nothing else gets ticked, that one needs to be taken and to the redial kind off list or what you'll be getting as part of this bucket. So I'm going to take some other things because I would definitely want to include some other DOTNET framework versions. No, the reality is that each version comes with its own compatibility, You know, support for certain things and also reverse compatibility for older systems. So I am just taking all of them to make sure that I have them as options when needs be. No, you look to the bottom right, and then they see the total space required is five points here for gigabytes, and that's just for one model. I could have ticked other models once again. I don't need them for this, but I'm just saying that visual studio is very powerful, and it allows you to select the kind of development libraries that you will need for your context. After selecting dot Net, they're stopping development that package. Then we can just go ahead and click install so this installer will proceed to Don't load all of the packages from the Internet, and this may take a while, so I will reconvene when this is done. Once that installation process is finished, then we can go ahead and launch is your studio. If it doesn't launch automatically along the way, you may be prompted to identify yourself using a live accounts. No, my live account is already kind off registered on my machine, so it automatically detected me on signed me in. But if you do not receive that automatic signing, then I encourage you just create a level content by live account. I mean, you can simply go to Microsoft dot com, proceed to click sign in. You don't have an account, so you just create one on then The cool thing is that you don't have tohave on act some micro saucers that kamajii me works at Yahoo Works. Whichever email address you use primarily. You can use that as your live account. And then once you've completed that registration with that live account, then for visual studio you can proceed to use that live account to sign in notes that the community addition is very free. But then they will tell you that you have a 30 day trial on that is really pending your creation off our live account and using it to authenticate in visual studio. Once you get to this screen. Then you know that your installation has been completed and as we go along with, see how we create a project and understand our development environments. 3. Install .Net Core SDK: to complete our development environment configuration, we need to install dot net core. This may not have come out of the box with visual studio or the version that was in visual studio, maybe a bit dated. So the latest version or the version at the time off this recording is dot net core 3.1 Soto, Get that one. You just goto dot net dot Microsoft dot com slash download Already could just google dot net core, and it will bring you to this site on. Then you can proceed to download the sdk. So you know, it says I have done that core 3.1 on the latest dotnet framework, which also may not have been included in that visual studio installation. So you can don't know both what I'm really good. I went to focus on the core because that's when we really want Andi. Just click. Don't know sdk. It will launch a don't load on. Then when that is finished, then we look at the installation process. When you launch the installer, it's pretty much straightforward. You just need to click install on, let it go through any security checks on, then it will just install dotnet core STK for 3.1, which at the time after this video was the latest version. So once that is completed and we reconvene at the end of the installation, you will see a confirmation page on the most important line here is the installation was successful. Once you see that you can click close Onda that's it for setting up your development environments. 4. UPDATE: Visual Studio 2022 Community Edition Tour: Hey guys. In this lesson we'll be installing Visual Studio 2022, which ships with dotnet six, which is the fastest dotnet yet. So to get started, we just need to go over to Visual Studio dot Microsoft.com slash downloads. And then we will go ahead and hit the free download on the community edition, which will then give us an installer. So once you run that installer, we will be able to select the workloads that we want. Workloads really refer to the libraries or the supporting libraries for the type of updates you're interested in creating. So in this case, we definitely want to get that web development ASP.net and web development workload. But then if you are interested in older technologies, you can go ahead and select them. So you can see I have several workloads selected with Azure development, NodeJS and desktop development. So you can go ahead and split those also. I think that they will come in handy with other projects that you might end up building. All in all, once you have done that, you can go ahead and hit Install, which would be done by the bottom right-hand corner. Of course, the more workloads you select is the bigger the download size. So once you've completed that, then you can continue. Now when that download is finished, you may get certain options that I am not going to get because I already have it installed. So this will walk you through what to expect. You may get an option where you get to choose your theme. As you can see, I'm using the dark theme, but then you do have the option of a light theme, a blue theme. And the thing is that Visual Studio 22 has many more themes than its predecessors. So even if you don't like the initial themes, you can get other themes if you need them. Also, you may be prompted to sign in. So if you already have 2019 installed on your machine and you are just installed in 2022, you already signed in 2019, then it probably won't prompt you to sign in again. However, if this is your first installation of Visual Studio, you may be prompted to sign in or create a live account, which point you would want to just use your Microsoft issued at live at all. Look at hotmail.com at cones. Or you can just go ahead and create one. And if I if my memory serves me correct, you can use an another non-Microsoft email address to create a lighter color. So if I go ahead and create a new project and do a new console up, C Sharp console up. And then this is just going to be VBS 2020 to demo. All right, head hit Next C. C is the same thing, but here I can choose which framework and I can now choose the latest dotnet six. So dotnet 5 was released last year and is occurring one dotnet three-point one sit as long term support. So it's still quite capable. And each one is actually backwards compatible. So five, most of what you do in three, most, if not all of what you do in 3.1 is still compatible with five. And most, if not all of what you would have done with these two can be forward, forward it to dotnet 6.net, 2.1, a lot of support. So I would suggest if you have any ups still in two-point one, that you start looking to upgrade or update them. Or at least if you're just learning dotnet Core, don't start with 2.1. So when we go ahead and hit Create, another thing I take note off. So I paused the video, but it wasn't really that Quetelet. I paused the video, but one thing I took note of is that it is much fossa. So thats is probably because it is on a 64 bit application, so it's making better use of your 64 bit machines resources than previous versions would have. So no, you're going to see Foster search times, faster load times. They'll solutions with 109 projects, it shouldn't take as long to load them up. So another thing that I want to point out is that this is a console app. And if you have any experience writing a typical C-Sharp application, you will know that there is a standard template where you have a bunch of using statements at the top. And then you have int main Java class, and then you have int main, and then you have the code in there. But here all I'm seeing is the code. So this is done at 66. Actually got rid of that whole template. So let me just add dotnet five console app project quickly. Let me just call this one demo, met five so we know Next, and then this one is done five. So that is what we're probably cost them too when we look at dotnet five projects or done it five console project or code file. So you have your class, you have your static void main, and then you have your code. However, in dotnet seeks, they got rid of the wrappers around all of that. And the just start writing code, right? So this is not, this is not a C-sharp tutorial. I'm just pointing all the little nuances in C-Sharp tutorial. I will definitely go through all of that and the differences between the dotnet, regular dotnet C-sharp and what dotnet 6 brings to the table. But it's really cool As far as I see it. Now another cool feature to me is it's increased intelligence when it comes to code hinting are hinting what you might be getting. That's why they are getting a quote. So I can see this as a huge productivity when the dope, the feature IntelliJ code. And you'll see that little icon down here that's allows you to kind of toggle some of the options. So if I type console, you see that it's kind of auto completing dot write line. It's not waiting for me to go into the list and then select it. I can just press Tab and then tub as long as they're agreed. Characters to the right of the cursor, I can press tab and then it will just fill them in, right? I am here. So let me try something else. If I do something like var, var num one is equal to and then seed suggesting that I probably want to initialize it to 0. Let me see if it's really that intelligent okayed. So just the norm to what if I wanted var name, what would it suggests var name? And then a space and then okay, So I guess I broke it. But you can see what it's getting at maybe. All right. So I guess varName is vague because you know, you need the type 4 to know what exactly what kind of variable It's going to be before you give the value. So if I said string name one, Let's see what it would suggest. String name1, know suggestions. Alright, so that's a feature, I guess that over time it will increase in its offering because this is really based on goal completions, based on other code samples from various repositories all over the place. So I guess random variable names that these are rarely used, which is probably why it's having such a hard time understanding what I am getting it. But then you can see with the num 1, num 2 if you've already told art, so I just press enter. It's suggesting console.log, line tab. And then it's going to suggest another one, tub. So read, they're just printed num one without writing a code line of code, I look at this, I press tab ones and I'm printing num 2. So I think, you know, as you use it, it will seem easier. It will make better suggestions. It's clearly contexts to all because it knows that num1 and num2 are in the document, are in the program. So it knows that he can suggest it later. Don't for my operations. 5. Tour Of Visual Studio: in this video, we're going to be pouring visual studio will be creating a simple console application for C Sharp on. We'll be looking at the interface and just getting familiar with all of the buttons and what all of them do. No, my visual studio is using what we call dark mode, which makes it black, so your own is probably silver or white in the interface, and I will show you how to change that. But for no, this screen launches whenever you click visual studio onto the left, you see a list off all of your recent projects off after a number of projects working on, I kind of collapsed them. So it's not toe. Put too much on the screen for display at this point, but your own will probably be empty, but you will have the option. So the right asking you to clone or check out open a project folder or create a new project so I'm going to click create a new project. This launch is the different categories off projects that are available to you. So based on the package that you would have installed, you may see more or fewer than I have on my screen. I have quite a few packages installed on my visual studio instance, so I'll have more options. But for the purpose off this lesson, we want to create a C sharp consul application so we can actually just search instead of trying to scroll through and look and try and figure out which one it is. We can search, or we can narrow it down by selecting the actual language that we want the environment that we want to develop something for, in this case, windows on the with its desktop or mobile. So be once again based on the packages that you would have installed. Then you can get that filter. So I chose C Sharp Windows console and then I have two options. I have a dot net core console up, and I have a dotnet framework console up. No, no. The difference between the tour dot net core console up creates a project that allows you to create a console application that can run on windows. Looks on dMarc OS over the traditional one. Up until Corky Mobile was just the regular dotnet framework, which created a project that can run on windows. So I'm just going to continue with the traditional dotnet framework application for no on. Then we can create a doctor core one later and compare. So I'm went toe, proceed with the dotnet framework. Click next, and then we give it a name. Someone to call this test nets console. All right, so in the project name, you want to avoid special characters as much as possible. And also, you probably want to camel case to make sure that it's readable. It is very case sensitives. If you camel case or you have a mixed case word, then rest assured that it will play a very big part in referencing anything inside the project going forward. This might be your default location based on your use anymore, your fullest set up on your computer, whoever you can always go to bro's and change where you want your projects to go. Next we have the solution name and I'll show you what the project name different from the solution name. But we can actually choose a different solution name as the project cause inside off a solution, and the solution can have multiple projects, so these two don't necessarily always have the same name. All right, on. Then we can select the version off, Done free, more that we want. So you can see that it has backwards compatibility open till dotnet framework to point. Or like I said, each framework has, you know, the latest one has more recent libraries and support for libraries. But then what works in the latest on me not work on an older computer, And then what was done on the older versions might not be very compatible with, say, Windows seven and Windows 10. So, you know, choose your battles fearful. You know what your environment is. But I have a Windows 10 computer, and I like to be on the cutting edge of things. So I leave mine at dot net framework 4.7 point two, and then I can doesn't take a cursory glance. Make sure everything is good and then click create. Once all of the preparations are done, Visual studio and launch on. Then we'll see a court file followed by you know, this wonderful interface and some other things. So the first thing I'm going to do, however you show you how to change the dark more if you're not already in Dartmoor andare interested, so you can go to tools, then select options on then the very, very first option in this dialog boxes allowing you to choose your college team. So you're probably in light or blue. You have blue contrasts and you have dark so you can to select there. Click OK on. Then you'll get this wonderful looking contrasted interface. No. Another thing you may not is that your solution Explorer is to your right minus to my left . I rearrange it that way because I find it easier to just move to the left to find the file . Sometimes I'm typing court here and they have to move all the way over to the right. I mean, it's it's really a month off layout on flexibility on whole. You prefer it? No visual studio. I lows you to put it the way you prefer it. So you can actually drug any, um, pain. They're called champions. You can drug drug, any pain, and then you can dock it where he wants. You see, these little, um, squares are tangles. If you dragged them into the space that it will kind of put it right in that section that is designated right or I can just leave it right there floating. But it's more for humbug here in the middle of the screen than anything. So I like my into the left so you can do that if you wish. If you want more real estate, sometimes you're right in court and Europeans are to the side, you know, open like this. Under take him too much space you may not have a big screen on. Do you want more space to do certain things You can always just unp in it. So you see, this pin is seeing auto heights. I can make it auto hide when that when I need it, I just click it and it comes out. I do what I'm doing and then it goes back. You'll also see that I have other pins that you know you may not have. So as the need arises and you feel that you need a pain, you can just go toe view and then you find the pain that you want. So, for instance, I have one here that's a sequel server object explorer on. That's like a mini database management system inside visual studio For this tutorial, you won't need that. But And for other projects I work on, I use it. So when I expand it, I see things in there. But then I'm not going to be using them for this for this set off lessons. Now, this court file that I had alluded to before this is our mean court file for our console up . So if I want to increase the fun size, I can just hold on on the control button and screw in and you see, I can screw up, are known to increase or decrease the size off the funds. So I'm just going to increase its a bit so that we can all see exactly what's happening on my screen in the solution Explorer. You see that the file name matches the class name. All right, so I'm not going to teach you chord in this, particulary less time. Just trying to point out some visual accused to make sure that when you see them, you know exactly what they need. Right? So we have the program dot CS and see sharp fathers are stored as dot CS the class files get extension. That's yes. But then you see that you have other files with different extensions, like not config on. As you put more and more in your project, then you're going to see different file extensions for different purposes. On being a bit more attention to the solution. Explorer, you notice that you have and I just expand minor bit. You have the solution and then you have and it does have a names. It's a solution testing console. But then under that, you see that it has another like a child, right? You see that indentation that suggest that this is a child off the solution? So this is the project which then has the project files. So I was saying earlier that the solution doesn't necessarily have to have the same name as a project. As a matter of a fact within the solution, I c