C# App Start To Finish Lesson 21 - Dashboard Form

preview_player
Показать описание


Check out this video to see how we are going to build a complete application from start to finish in C#. Using .NET and Visual Studio, we will construct an application that is fit to launch. The application will use Winforms, a class library, events, SQL database, text file data storage (in CSV format), custom events and more. This is a 25-hour course that will allow you to follow along as I build an entire application, all for free!
Рекомендации по теме
Комментарии
Автор

Very nice video... I've been stopping the video and writing the code ahead of time, as much as I can, then watching the video to see how Tim does it. This helps a lot.

dctackett
Автор

Since i can only give this videos one thumbs up. I will say thanks instead. Very helpful.

Saratoga
Автор

Another great lesson. Thank for sharing.

Federrocky
Автор

Tim, I think u can get round so easier
if u consider any tournementmatchups=2^n -1
then u can just catch n by one simple division methode
and after that, u can populate them by matchup round equla to number of rounds

and because u ordered it by matchup round in SQL u don't even need that if clause.

pouriakalantari
Автор

Woohoo!! After taking a long break I completed Chapter 20 and I feel relieved. To all the people stuck, hang in there. It gets better :)

msaurabh
Автор

One optimization is that you already hit the database for the TournamentEntries and populated the members and also got the list of Matchups. Since you have these already in your tournament object you can use those with a Where(***) instead of taxing your db server and slowing the app with calls to a server that may not be on the same machine.

chriswilson
Автор

@8:07 It does seem that you only need the Tournament Name and Id for the dashboard form and you could wait until the LoadTournamentForm to actually call up the specific information for the selected tournament. If you only want to create a tournament (or edit one tournament) that seems to be a lot of info to be pulling in. Maybe this is the approach you end up taking so I will have to just follow along.

kemmrich
Автор

Hello Tim. Could code from the GetTournament_All method get into a production? I mean, it seems that Dapper isn't good enough for such complicated logic. if we used EF, would we get less lines of code or not? Thanks.

nikitandreev
Автор

Great videos, Tim. I've come a long way with your help. One question, should I make a new dapper connection for each query, or pass the same connection around? Right now, I've got some nested routines that pass the connection, and the connection seems like it's closing before it's done being used.

skanyer
Автор

Hey Tim, great lesson - I've been away for a few weeks and come back to this lesson and it was all smooth sailing (surprisingly retained alot of information from the previous lessons!!! Whic is a win for me haha) until I hit play and got a "Object reference not set to an instance of an object." on the line "List<TournamentModel> tournaments = .

I've gone back and checked all the code in the GetTournament_All method and cannot fathom why it's not working >.<

DrowninGGaming
Автор

Great Work Tim!! just a question. when you gonna release next lesson from this course?!! im just at lesson 6 and i hope i can finish it!! Thanks!

neymarsr
Автор

A question : Sir have you done anything about the checking of availability of the database.
Lets suppose the I don't have sql server on the same machine, its on the different machine but within the network.
What changes will i be making to my code and how will i test if the connection is created and it actually is saving the data.

invokergaming
Автор

Hi Tim, these have been absolutely great. someday i want to make my own tutorials,
what screen recorder do u use to make these videos?

owengiri
Автор

Is it good design to have your C# code become reliant on your Data Storage logic?

1. Your unique IDs are being generated by SQL Server and then injected into your Models after they are saved. Not a problem, just an observation.
2. You have now added extra properties to many of your models to store just the ID of child models. But these values are already accessible through looking at the actual child models, so we have duplication of data and the potential for a mismatch.
3. Your loop for loading MatchupModels 35:00 - 41:00 depends on the SQL stored procedure ordering by MatchupRound (28:32). If that gets changed or removed, I suspect the tournament model will not be reconstructed correctly.


From this set of tutorials and many of your other vids, am I right in thinking you generally adopt a "data first" approach to design? That is, you create your database tables and fields first, then build your object models and "business logic" in the code based on your database design?

duncanmcdonald
Автор

Thank you for sharing your valuable knowledge. Can you please tell me how to convert problem into a solution using code?. This is where i feel i need to work on. Your help is appreciated sir.

vinuhosanagar
Автор

Tim,

Thanks for the videos. Not sure if anyone else ran into this issue but I had to .FirstOrDefault() while populating the matchup model in GetTournament_All(). The error being displayed was 'sequence contains no elements' . This occurred when rerunning the application after creating the tournament.

stick_wick
Автор

Hi Tim. MatchupEntries table has 3 foreign keys, which tables do each one of them refer to? Thanks

A-M-F-A
Автор

Tim FIRST() for LinQ is problematic I replace it with FIRSTORDEFAULT().

pouriakalantari
Автор

When populating the rounds (around the 38 minute mark or so) instead of doing more looping and checking the current round, etc., couldn't you just add something like this:

if (m.MatchupRound > t.Rounds.Count)
{
t.Rounds.Add(new List<MatchupModel>());
}

t.Rounds[m.MatchupRound - 1].Add(m);

kevinicus
Автор

I have problem with Tournament Viewer For, im reverted commit to this point but still nothing changed. I have tournament names list in this form (dashboard) but when i click load, only loads tournament name in Viewer but matchups list is empty(i can choose 2 blank options). Everything was okay before 23 lesson, now im stuck. Today i wasted almost 10 hours on debug, probably GetTournament (this method to get all info about tournament, i forgot name) don't get or don't display data. Probably i damaged my database, i get sql error and on SO people said i'm trying to update non existing record so i changed ON UPDATE to cascade in few tables, but error was in my code (typo in @name). So i reverted all cascades. I f*cked up base or just start from scratch (this lesson) and rewrite code ? Sory for my english, it isn't my native and after 15 h im little bit tired.

bagietmajster