ASP.NET MVC Data Access in C# - The complete data path from database to display and back

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 1.3K

  • @formerfatboy90
    @formerfatboy90 2 ปีที่แล้ว +11

    I'm a junior developer at a large company. I've been trying to build on this very complex QA application for weeks and feel like a fool for not seeing how the pieces are fitting together, connecting DB to backend to frontend, etc. Your deliberate, explicit instructions are helping me to document the MVC process in my own code and on Miro. This video is really helping me for my career. Thanks, Tim.

  • @vinuhosanagar1
    @vinuhosanagar1 6 ปีที่แล้ว +19

    While it is very evident that your quality of teaching is fabulous, your commitment and consistency in educating community of developers is amazing
    I know it requires a lot of efforts to produce such long videos with best quality that too consistently. We all appreciate your contribution sir. Hope you be known to whole dot net community. God bless :)

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      I appreciate the kind words.

  • @jackfitzgerald5735
    @jackfitzgerald5735 4 ปีที่แล้ว +3

    0:00 Intro
    1:14 Project setup
    4:25 Implementing employee sign-up form
    12:00 Adding requirements to employee form
    23:10 Making a quick form with html.EditorForModel()
    25:28 Understanding how the employee form works in SignUp.cshtml
    27:54 Handling the employee form in HomeController.cs
    32:45 Creating the Employee table
    40:00 Creating the EmployeeModel class in DataLibrary
    44:00 Using Dapper to interact with the database
    52:09 Implementing the EmployeeProcessor class to handle the business logic
    59:39 Using the EmployeeProcessor class to store employee data
    1:04:22 Displaying employee data by using the EmployeeProcessor class
    1:12:44 Ending review

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +3

      That is a great start. I know doing this time stamping is very time consuming but its a HUGE help to many students. If you get thru the rest of the video and capture the main topic timestamps, I will gladly add it to the video. Thank you for making a significant contribution to the community.

    • @jackfitzgerald5735
      @jackfitzgerald5735 4 ปีที่แล้ว +1

      @@IAmTimCorey Thank you Tim, you have given me the motivation to finish this. And thank you for making great content, I just started learning C# and MVC and your videos have helped me out a lot with understanding how this all works.

  • @Arrato1977
    @Arrato1977 2 ปีที่แล้ว +2

    I watch your tutorials few days in a row now. Speechless, you are the best teacher I ever seen.

  • @chrismtz2020
    @chrismtz2020 4 ปีที่แล้ว +4

    For those of you who are having issues with your database, here's some advice (after 1 week of listening to this video over and over again):
    -> When you update your DB, make sure to publish it again
    -> Put your Database and DataLibrary in the same folder as the MVC project to make things easier.
    -> ConnectionString should be the exact DB that you're using. Make sure you copy and paste it right too.
    -> Make sure when you call your DB, to tripple check the spelling (ex. dbo.Users not dbo.User)
    -> Also, you might get errors using a Database named called "dbo.User". If so, either rename it or use "dbo.[User]" to fix your problem.
    Good luck everyone! Google your mistakes and dont be afraidto try again and again on your project.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +1

      Thanks for sharing. Great job sticking with it.

  • @lukaskarlgerhard
    @lukaskarlgerhard 2 ปีที่แล้ว +1

    I can’t begin to tell you how helpful your videos are, in just over an hour you’ve helped me understand what it’s taken me all week at work to wrap my head around. I have so much of your content bookmarked. Thank you so much Tim

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I am glad it was so helpful.

  • @gff2112
    @gff2112 4 ปีที่แล้ว +3

    You're an awesome instructor Tim.

  • @fatimaajij428
    @fatimaajij428 5 ปีที่แล้ว

    Every time when I watch your Tutorials, I find the actual logic how people work in software Companies. Thanks for Amazing videos.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      You are most welcome. Thanks for watching.

  • @greendeer2437
    @greendeer2437 3 ปีที่แล้ว +4

    public static int SaveData(string sql, T data)
    {
    using (IDbConnection cnn = new SqlConnection(GetConnectionString()))
    {
    return cnn.Execute(sql, data);
    }
    }
    Hi, Thanks for the tutorial.
    I have tried to run the solution like at 1:02:38 but it gives me error on line "return cnn.Execute(sql, data); " saying that there is an Incorrect syntax near 'value'.
    The break point does not get hit. How can I resolve this?

    • @neutronstar6739
      @neutronstar6739 2 ปีที่แล้ว

      For future people, sounds like you miss `s` on the `values` there. Syntax for SQL Insert would be
      INSERT INTO your_table(column_name)
      VALUES (column_name_value)
      So with this in mind, in this case it would be
      INSERT INTO dbo.Employee(EmployeeId, FirstName, LastName, EmailAddress)
      VALUES (@EmployeeId, @FirstName, @LastName, @EmailAddress)
      It's recommended to look into SQL syntax and educate yourself on SQL injection to understand these.

  • @raduionita4496
    @raduionita4496 5 ปีที่แล้ว +1

    I can't thank you enough Tim. I have been struggling for over 2 weeks to find how to do this, and you saved me! Thank you very much. Love you! Subscribed.

  • @aymanmetwally5560
    @aymanmetwally5560 3 ปีที่แล้ว +8

    Thanks .. is there a .Net Core version?

  • @madhavmehendale7324
    @madhavmehendale7324 4 ปีที่แล้ว +1

    Strange as it may sound - this video is symphony. I followed each line of code by coding it in parallel in VS2019 - taking time to savour the notes of logic, the melody of the architecture and the rhythm of the underlying logic as the whole application came together like a musical crescendo. Life is good.........!

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad you found it so pleasing.

  • @James-zr1lu
    @James-zr1lu 4 ปีที่แล้ว +3

    I'm getting the error "System.NullReferenceException: 'Object reference not set to an instance of an object.'" @ 11:48.
    I have copied everything exactly as in the video. I have also run the source code and still get the same problem. My only difference is that I'm using the latest Visual Studio 16.7, .NET Framework 4.7.2. May the problem may lie there? There are others in the comment section that are having the same problem with no solution.
    Thank you

    • @James-zr1lu
      @James-zr1lu 4 ปีที่แล้ว +2

      Well, if I change return view() to return View(new Models.EmployeeModel()); for ActionResult SignUp() in the HomeController, then that works.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I think maybe you created a different form, maybe an Edit form instead of a create. I just recreated this in a new project in Visual Studio 2019 (16.7.2) with .NET Framework 4.7.2 and it worked as I demonstrated in the video.

    • @James-zr1lu
      @James-zr1lu 4 ปีที่แล้ว

      @@IAmTimCorey That can't be it because I also tried using the source code that you provided via the download link in the description. We are using the exact same code yet producing different outcomes. At least I have a work around as I provided above.

    • @christianconder35
      @christianconder35 4 ปีที่แล้ว +1

      Hi James. I also have been struggling with the exact same issue as you. I have managed to find a solution. I had placed the connection string into the wrong Web.config file. @ 39:14
      Check that you have the connection string in the correct Web.config.

    • @christianconder35
      @christianconder35 4 ปีที่แล้ว

      @@IAmTimCorey
      Mr Corey, I really enjoyed the tutorial but I did not initially see that there were two Web.config files and I placed the connection string in the Web.config inside the views folder. Just some feedback

  • @omniterry
    @omniterry 5 ปีที่แล้ว

    Getting addicted to watching your videos. Love your voice and how you pay attention to all the little details. Thank you

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      You are most welcome. Thanks for watching.

  • @rokkrdude
    @rokkrdude 4 ปีที่แล้ว +7

    I am having an issue with the LoadEmployees method in the employeeprocessor. my error is inconsistent accessibility and it claims that the return type is less accessible than the method. can you help me?

    • @James-zr1lu
      @James-zr1lu 4 ปีที่แล้ว +7

      @Garrett Sullivan From memory, I had the same problem. It was because the EmployeeModel class in the Models folder in the DataLibrary folder was not set to public.

    • @orientgamessa1340
      @orientgamessa1340 4 ปีที่แล้ว +2

      @Garret Sullivan Thanks so much for asking this question! I was experiencing this too! @@James-zr1lu Thanks so much for the answer! helped tremendously!

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +3

      Its great with the community helps each other out. The IAmTimCorey community members are some of the best!

    • @haramboy6932
      @haramboy6932 4 ปีที่แล้ว +1

      @@James-zr1lu U Mad LAd

    • @mierLG
      @mierLG 4 ปีที่แล้ว +1

      thanks @@James-zr1lu , save me a lot of time

  • @tccoder3547
    @tccoder3547 2 ปีที่แล้ว +1

    This video was great for me, because I had a hard time understanding how MVC design worked. You also helped me understand validation and model binding as it relates to Model state. You rock Tim Corey!

    • @IAmTimCorey
      @IAmTimCorey  2 ปีที่แล้ว

      I am glad it was so helpful.

  • @robmooreproductions7160
    @robmooreproductions7160 5 ปีที่แล้ว +4

    Is anyone else having trouble with the ConfigurationManager thing at around 46:45?

    • @traktor207
      @traktor207 5 ปีที่แล้ว +1

      You can right click on references in the solution explorer and add System.Configuration manually.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +2

      Yep, TraktorFerguson is correct.

    • @mohammedal-haifi6037
      @mohammedal-haifi6037 5 ปีที่แล้ว

      @@traktor207 Thanks. worked for me

    • @alialsaady5
      @alialsaady5 5 ปีที่แล้ว +2

      To be more specific you must do the following:
      Right-click on References and click on Add Reference. In Assemblies, select System.Configuration and click OK.

    • @glebfrolov3557
      @glebfrolov3557 4 ปีที่แล้ว

      for me for some reason worked also adding into references System.Configuration.Install

  • @OmniTato
    @OmniTato 3 ปีที่แล้ว +2

    For those struggling with an error saying "System.NullReferenceException: Object reference not set to an instance of an object", check that your connection string is in the CORRECT web.config file. It SHOULD be in the Web.config below packages.config and Global.asax in your MVCApp project, NOT the one under views, shared, Web.config. This solved my problem =)
    Hope this helps those who are struggling, because I sure as hell nearly pulled my hair out hahaha

    • @tomthelestaff-iamtimcorey7597
      @tomthelestaff-iamtimcorey7597 3 ปีที่แล้ว +1

      Thank you for sharing this. I'm sure it will help others.

    • @lucasisaac8063
      @lucasisaac8063 3 ปีที่แล้ว

      Mine was already in the correct web.config folder, but thank you for the advice. Tim said in another comment, that a class or a variable needs to be instantiated. I copied his code line for line (Or so I thought) and I still can't find it... Again, thank you for the advice

  • @VictorGarcia-si8wy
    @VictorGarcia-si8wy 3 ปีที่แล้ว +3

    I commend you for not even attempting to try to store passwords. I've stored passwords before and I never want to do it again.

  • @species-xo4tz
    @species-xo4tz 3 ปีที่แล้ว

    More then 2 year ago i had to stop developing and begin learning and maintaining solutions build in ssis, stored procedures using functions, triggers the whole lot.. . Recently I’m starting to develop again. Your videos has help me a lot getting back into development, thank you. You’r for sure one of the better trainers i have found, keep up the good work.

  • @christiandiomangay5107
    @christiandiomangay5107 3 ปีที่แล้ว +4

    Inconsistent Accessibility:return type 'List' it seems there is an error in the class privacy in the buisness logic
    please help tim ..

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +3

      It sounds like EmployeeModel is not marked as public.

    • @christiandiomangay5107
      @christiandiomangay5107 3 ปีที่แล้ว +1

      @@IAmTimCorey Wow great! Thanks for the fast response sir Tim (bow)

    • @immortal7167
      @immortal7167 3 ปีที่แล้ว

      how did you fix this issue ? I have already added the keyword public

  • @cagataysert1995
    @cagataysert1995 6 ปีที่แล้ว

    I just want to say how thankful I am for all your videos. I hope you can add more videos related .net. Thank you again Sir.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      You are most welcome. Thanks for watching.

  • @victorkimura1
    @victorkimura1 3 ปีที่แล้ว +3

    Hi Tim, I receive an error at around 59:15 when entering "LoadEmployees" ( th-cam.com/video/bIiEv__QNxw/w-d-xo.html ). Visual Studio states Code CS0050. Inconsistent accessibility: return type 'List' is less accessible than method 'EmployeeProcessor.LoadEmployees()'. I'm a beginner in C# coming from a PHP background. I understand the main concepts thanks your gifting in teaching. :) But is anyone having this problem? If so, how do I resolve it as I can't load the page. I followed along every step of the way. Thank you for your help.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +3

      That message means that you missed adding "public" to one of your properties or classes. My guess is that the List is not set to public. If not that then the EmployeeModel is not set to public.

    • @victorkimura1
      @victorkimura1 3 ปีที่แล้ว

      @@IAmTimCorey , Hi Tim, Thank you for the reply. I'm very grateful and appreciative that you took the time to respond. I'll check when I'm back at work Monday. I think I checked the public settings but I'll check again and perhaps I'll go through the tutorial on my home computer too. I really like your teaching as you encourage others to write the code step-by-step and this is one of the best ways to learn. I pray the blessings from Numbers 6:24-26 upon you and your family:
      “‘“The Lord bless you
      and keep you;
      25 the Lord make his face shine on you
      and be gracious to you;
      26 the Lord turn his face toward you
      and give you peace.”’

    • @webluke
      @webluke 3 ปีที่แล้ว

      @@IAmTimCorey Ran into this too. I missed setting the DataLibrary.Model.EmployeeModel class to public. The error VS gives, and the help in the docs is not very useful.

    • @mamahumen
      @mamahumen 2 ปีที่แล้ว

      Is there any answer to this?

    • @UltimatePiccolo
      @UltimatePiccolo 2 ปีที่แล้ว

      @@mamahumen I had the same problem, I fixed it by going into the "EmployeeModel" class in the "Models" folder, and making the class public. My line 9 now says "public class EmployeeModel" and I no longer have the error.

  • @DiddleDangle
    @DiddleDangle 5 ปีที่แล้ว +1

    I know this doesn't have to do with the content of the video, but I love how you handle the audio in your videos. I feel like I get to the end of your videos and it feels like only 10 minutes have passed while other lecturers drone on for hours and it really feels that way because you can hear a constant buzzing in the background or every spit wad in their mouth. Thank you for creating such cleanly edited and planned out videos. Looking forward to your content always.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      I am glad you appreciate the audio quality. I do put a lot of effort into it (even though audio editing is not a skill of mine).

  • @dariogiordani2002
    @dariogiordani2002 2 ปีที่แล้ว +3

    Hi Tim thank you for your tutorials, fantastic work. I've ran into an exception on final test run at the SqlDataAccess. return ConfigurationManager.ConnectionStrings[connectionName].ConnectionString;... System.NullReferenceException: 'Object reference not set to an instance of an object.' - Hard to diagnose from three lines but do you have any thoughts? Thanks

    • @Vyrkadian
      @Vyrkadian ปีที่แล้ว

      I'm getting the same error, did you fix it?

  • @mmuneebajaz
    @mmuneebajaz 6 ปีที่แล้ว +1

    Big thumbs , one of best channel on youtube i ever found for .Net

  • @AamerKhawaja
    @AamerKhawaja 4 ปีที่แล้ว

    Hello Tim, this was the best MVC tutorial on youtube hands-down. This comes from someone who's been through tutorial-hell. Excellent job!

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad it was so helpful.

  • @bandermaster81
    @bandermaster81 4 ปีที่แล้ว +1

    I enjoyed the tutorial and learned a lot! I like your style of teaching, you explain everything. While others just assume we know things.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I'm glad you enjoyed it and that you found it valuable.

  • @chiefxtrc
    @chiefxtrc 5 ปีที่แล้ว

    these kind of overview videos are very necessary and underrated, I hope you keep implementing them

  • @kennington4375
    @kennington4375 4 ปีที่แล้ว +1

    Would love to see more ASP.NET. Your doing such a great job. It's much clearer and better than courses in University.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      More to come!

    • @kennington4375
      @kennington4375 4 ปีที่แล้ว

      @@IAmTimCorey Sending emails and using Webforms would be great :)

    • @mokatemoreki8620
      @mokatemoreki8620 4 ปีที่แล้ว

      Indeed this is much better than in University, worst in university such topics of MVC are not covered we only do C# and Desktop Apps if we are lucky

  • @RalfsBalodis
    @RalfsBalodis 4 ปีที่แล้ว +2

    Minor adjustments to existing time codes.
    Credit to Jack Fitzgerald
    0:00 - Intro
    1:13 - Creating ASP .NET Framework app
    4:35 - Adding MVC data Model
    6:20 - Sign-up form: new MVC Controller action and View with "create" template
    12:56 - Signup-form configuration and validation: data Model annotations
    23:41 - Crude sign-up form: Html.EditorForModel()
    25:27 - Sign-up from code walkthrough
    27:53 - Posted data validation: Controller POST action
    32:43 - Posted data storage: Database table design
    38:15 - Posted data storage: Database connection string
    40:00 - Data Model for database
    43:39 - Data access with Dapper
    52:09 - Data access Business Logic
    59:40 - Storing posted data in Database
    1:04:39 - Accessing and displaying data from database.
    1:12:44 - Summary and concluding remarks

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +1

      Thanks for the update!

    • @User_00128
      @User_00128 4 ปีที่แล้ว

      @@IAmTimCorey am trying to move from using webforms to MVC and am wondering is it dangerous to put our query in the controller or its ok you just put them in the logic to make it more universal ? by the way you explain everything better than my university's web dev instructor i have been watching this on repeat for like ten times lol greatly appreciated

  • @pierreplourde
    @pierreplourde 3 ปีที่แล้ว +2

    Very helpful to see the full stack like this, as to how all the pieces fit together.

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว +2

      Glad it was helpful!

  • @albasula216
    @albasula216 4 ปีที่แล้ว +1

    I loved the vid ... i bought a udemy course for this and it was terrible... the teacher was saying this is beyond the scope of this course but u can find it in my other udemy course...and that happended multiple times...it was really hard to understand what he was doing...and not even close to this way of coding...thank u so much for your great work ....I actually have a task to complete in order to get a job as .Net dev and this helped a lot...thank u so much...I will consider buying one of ur courses but when I get the job...bc a bit expensive ...but it is worth it bc of the great material and great way of teaching...again thank u and u won a new subs and supporter 😊

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว +1

      I'm glad this video was so helpful.

  • @tomsupis8724
    @tomsupis8724 4 ปีที่แล้ว +1

    Thanks, Tim, was a great video, def better than my last coach. Had multiple errors, but I handled them like a champ, and the comment section helped a lot. Looks like its better if I learn some SQL before I continue with ASP.net

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I'm glad it was helpful.

  • @bigtimecoder2588
    @bigtimecoder2588 4 ปีที่แล้ว

    AWESOME FRIGGIN TUTORIALS DUDE . . . YOU EXPLAIN IT SO CLEARLY AND WITH EASY EXAMPLES INSTEAD OF GOING OVER OUR HEADS . . . AND DON'T WASTE ANY TIME BEFORE JUMPING INTO THE CODE. LOVE IT MAN, I WANT TO SIGN UP FOR YOUR COURSES AND MENTORSHIPS STUFF REALLY BAD BUT IM KIND OF POOR RIGHT NOW.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad you have found my content so helpful. The good news is that you can learn a ton for free.

  • @kevinbrosnahan2416
    @kevinbrosnahan2416 4 ปีที่แล้ว

    Awesome video! I learned so much more today even having programmed in ASP/VB.NET Web Forms for over 10 years. Your MVC video was incredible as well. Soon I will be adding MVC5 to my resume!

  • @yogevgershon3424
    @yogevgershon3424 4 ปีที่แล้ว +2

    37:14
    Dear Tim, I love your videos! it helped me a lot to improve myself (4 year programmer), you said as a rule dont use password as plain text into you db, which I fully aggree, but you just explaind why not to do it, and not how to do it correctly (with somekind of guid or hashing)
    Would really love of you to make a video of authantication on MVC.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      Use a system like Microsoft Identity (I use it in the TimCo Retail Manager series and a couple other videos). The big thing is to not design your own system.

  • @ernandojeanny1393
    @ernandojeanny1393 4 ปีที่แล้ว +1

    Very good guy your explanation of the subject! I was looking for several days without finding an article that showed and commented as well as his video. Congratulations!
    It helped me a lot to clarify doubts.
    Muito boa sua explicação do assunto cara! Passei vários dias procurando sem encontrar um artigo que mostrasse e comentasse tão bem quanto seu vídeo.
    Parabéns!
    Me ajudou muito a esclarecer dúvidas.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad it was so helpful.

  • @Beveelyhillbilly
    @Beveelyhillbilly 3 ปีที่แล้ว

    Nailed it Tim. Nice one. Just what I needed, someone who went through data connection without all the automation. You get from me an A++

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      Thanks!

    • @Beveelyhillbilly
      @Beveelyhillbilly 3 ปีที่แล้ว

      @@IAmTimCorey Hey just trying to extend on the content, do I need to create individual save load classes in dataaccess proj. I feel like my program is loading fom multiple forms automatically and getting stuck at dbaccess

  • @MaddCoder
    @MaddCoder 6 ปีที่แล้ว +1

    Great video Tim. Exactly what I was looking for and straight to the point.

  • @ejkenny
    @ejkenny 6 ปีที่แล้ว

    Another amazing ah ha tutorial. You have a great way of putting concepts into English and demonstrating with simple code. Thank you !

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      Excellent! I am glad it helped you out.

  • @jinsmp
    @jinsmp 4 ปีที่แล้ว

    I much appreciate you this type of tutorial. Every person can understand and can fast learning. This is a really good tutorial.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      Glad it was helpful!

  • @iantrembirth6918
    @iantrembirth6918 5 ปีที่แล้ว

    Tim, I'm starting to make the move from web forms to MVC for a pretty big project and have read a couple of books and seen a few video tutorials (including one on Channel 9), this is the clearest explanation yet of how MVC works and how to actually get it to do something. Thank you!

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I appreciate the kind words. I'm glad you found it clear and helpful.

  • @abdulmudhir4042
    @abdulmudhir4042 4 ปีที่แล้ว

    Why Are you such an amazing dude? I am always super excited to watch your videos even before going to bed

  • @krogilds
    @krogilds 5 ปีที่แล้ว

    Really useful Tim, thank you. I understand it now (I think). I had an issue, but found it. This is absolutely wonderful. You are doing really great work, and I am supporting you through your Patron page.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I appreciate the kind words and the support.

  • @philippeanglard7394
    @philippeanglard7394 3 ปีที่แล้ว +1

    Thank you for your tuto! English/American isn't my native langage, but I hink I was understanding you at 95%.

  • @johnreyp.canillo6569
    @johnreyp.canillo6569 4 ปีที่แล้ว +1

    Ive watch from the start until the End! Your such a good instructor❤️😍😍

  • @hamudaanfoune839
    @hamudaanfoune839 5 ปีที่แล้ว

    This was awesome. I am new to MVC and been struggling to wrap my head around it, but this has mad it very clear.. Thank you!

  • @michaelwong6004
    @michaelwong6004 3 ปีที่แล้ว +2

    34:00 Adding the IDENTITY specifier when creating table is important, because it tells SQL server to assign auto increment id whenever new entry is added to the Employee Table. I missed that part and spent some time to figured that out.

  • @vbgSnake
    @vbgSnake 4 ปีที่แล้ว

    Love your classes Tim, really good, great depth and not to focused on stuff. Its also easy to have you on monitor2 while i do your class on monitor1 in my studio. Super thanks. BR

  • @antonlyamin3318
    @antonlyamin3318 5 ปีที่แล้ว +2

    Tim your channel is an absolute goldmine of programming knowledge. It amazes me how well you relate all your coding to the higher level programming concepts you aim to explain. I have used your MVC videos to introduce myself to the field of web development. Because of you I am confident in creating a simple website using MVC and am now looking to expand my horizons. However I have encountered an problem. There seems to be so many directions to go from here, and I'm struggling to figure out which are most relevant and useful to me. My question to you is, for someone interesting in web development, who has a solid understanding of OO principles, SQL and front end design langauges (css, javascript, html) yet has only started to combine them using platforms like MVC, what are the next steps to take?

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I would look at .NET Core, and specifically Razor Pages (here is a video: th-cam.com/video/68towqYcQlY/w-d-xo.html ). Then, start practicing. Build test projects and learn how the pieces fit together.

  • @davidramirez3322
    @davidramirez3322 5 ปีที่แล้ว

    I could manage to confirm what yuo teach us. Really great tuto! everything worked fine for me, and I could learn a lot watching your excelent way to drive all the stuffs and concepts in a very concrect mode. Thnks a lot.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      You are most welcome. Thanks for watching.

  • @rudreshangadi4496
    @rudreshangadi4496 5 ปีที่แล้ว

    One more fruitful productive morning .. Excellent dear Mr. Tim.. Very clear, neat and upto the mark.. I am getting confidence to work on my entity framework web application that is going to start right from tomorrow :-)

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I am glad it was so helpful.

  • @alevsoft
    @alevsoft 4 ปีที่แล้ว

    A deep and warm "Thank you!" from the bottom of my heart! You are my man XD. No, really. Only your lessons made my way through.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      You are most welcome. I'm glad they were so helpful.

  • @rajnhard
    @rajnhard 5 ปีที่แล้ว

    Good video Tim, thanks. It`s also worth mentioning, that the Id of the Employee table (PK), supposed to be set IsIdentity to yes and also enable identity increment ( mine was defaultly set to false ).

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I didn't point it out (and I should have) but at 33:58, I add "IDENTITY" at the end of the ID column. That sets it up to be an identity column with an auto-increment value of (1,1).

  • @simonjsaunders
    @simonjsaunders 6 ปีที่แล้ว

    Thank you so much Tim. I'm really looking forward to the Core video that might be in the works. This has been an incredibly timely and helpful video

  • @BYFav
    @BYFav 3 ปีที่แล้ว

    Thank you Tim for this great tutorial! I really appreciate the also delivered valuable hints to methodology. This makes your videos first class.

    • @tomthelestaff-iamtimcorey7597
      @tomthelestaff-iamtimcorey7597 3 ปีที่แล้ว +1

      Tim's goal is to educate, not just dump information on folks. I'm glad you can appreciate that.

  • @hawnyawk1
    @hawnyawk1 6 ปีที่แล้ว

    Thanks for the video Tim, I recently got a VB6 to Web project dumped on me, being mostly a desktop programmer I was lost on what to do. This video made it clear that MVC was the way to go. Thanks so much.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      You are most welcome. Thanks for watching.

  • @Motuochez
    @Motuochez 5 ปีที่แล้ว

    Great video! I did miss a lot of logic of the methods and the classes and didn't really understand what does what exactly but just like you intended, this video is great for understanding the whole process and the bigger picture!

  • @meeradhumne4685
    @meeradhumne4685 3 ปีที่แล้ว

    Nicely demonstrated. Love the way you put it together. Thanks so much for the tutorial!!

    • @IAmTimCorey
      @IAmTimCorey  3 ปีที่แล้ว

      Glad it was helpful!

  • @TAPE5IVE
    @TAPE5IVE 4 ปีที่แล้ว +1

    Great tutorial. Very helpful for my .NET module as part of BSc Computer Science Honours degree. Thank you 🤙🏼

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      I am glad it has been so helpful.

  • @RudiHansen
    @RudiHansen 6 ปีที่แล้ว +1

    Great video as always thanks.
    But a little late :-)
    I just finished my first MVC app for a client today using your old video (Introduction to ASP.NET MVC) and some Google Foo, i think this video would have saved me about one day of work :-)
    Now instead I have some refactoring to do....

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      Bummer. Sorry it didn't come out a bit quicker. Maybe next time.

  • @benja-min1588
    @benja-min1588 4 ปีที่แล้ว

    Found this video immensely useful in 2020. Great Job, take my sub and gratitude!

  • @SirHonore
    @SirHonore 6 ปีที่แล้ว +1

    Hi Tim, thank you for another great video.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      You are most welcome. Thanks for watching.

  • @nuthouse99
    @nuthouse99 5 ปีที่แล้ว

    Outstanding video - easy to understand gives a usable example from which to build.

  • @khanhzodoi
    @khanhzodoi 4 ปีที่แล้ว

    So many things to learn in just a video. Thank you very much!!!

  • @chengfeng6375
    @chengfeng6375 6 ปีที่แล้ว

    It's the best one I have never seen, thanks Tim.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      You are most welcome. Thanks for watching.

  • @mariustaboo
    @mariustaboo 6 ปีที่แล้ว

    Nice one! Another great mini tutorial from Tim Corey.

  • @dperfetto89
    @dperfetto89 ปีที่แล้ว +1

    This video was helpful and at a good digestible pace. Thanks!

  • @kataseiko
    @kataseiko 6 ปีที่แล้ว

    35:20 "That limit is a maximum of 64 characters (octets) in the "local part" (before the "@") and a maximum of 255 characters (octets) in the domain part (after the "@") for a total length of 320 characters. However, there is a restriction in RFC 2821 on the length of an address in MAIL and RCPT commands of 254 characters."

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      Interesting. There used to be exceptions (I believe for Arabic and one other character set) that greatly increased the length but I don't see those anymore. Good to know.

  • @rizreighnand6471
    @rizreighnand6471 5 ปีที่แล้ว

    great explaination! i saw asp.net as a complicated framework but you explained it very well
    subbed!

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I appreciate the kind words.

  • @lukehewitt604
    @lukehewitt604 4 ปีที่แล้ว

    Thank you for the very clear tutorial Tim! It helped me understand a lot!

  • @joshuatindoc1013
    @joshuatindoc1013 4 ปีที่แล้ว

    Very informative Demo Thank you. You're a great influencer God bless you

  • @woozy_deer
    @woozy_deer 6 ปีที่แล้ว +1

    Hey Tim, could you do a video on attributes/pre-processor directives? Having trouble with that topic, use-cases, when to use them, where the standard library attributes apply, etc. Your videos are great, I always look forward to new ones popping up in my notifications, thanks!!

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว +1

      Sounds like a good video topic. I'll add it to the list.

  • @JustQASME
    @JustQASME 3 ปีที่แล้ว

    This is a great tutorial. Easy to follow and implement. Thank you so much!

  • @davemcpherson3346
    @davemcpherson3346 5 ปีที่แล้ว

    Tim, I followed several of your videos as I started learning ASP.NET with MVC. They've been a great help to me in forming the basis of a project idea I'm working on. I've learnt a lot from the videos and been able to expand my knowledge from your tutorials: they've been a great help. Thank You. I've recently started deploying the app to IIS for testing, using SQL Express as the database. There were a few teething problems related to permissions, which I was able to resolve. One point I have difficulty with is creation of the data tables in the SQLExpress database. I'm using Identity framework (from another of your videos) and found that the identity database tables are created automatically. However I find the application tables (dbo.Table etc) are not created. I googled extensively and can only find recommendations to use EF. I don't want to migrate / refactor, so can you suggest how I can get the .sql files to run to create the application data tables? I have 30+ tables, so don't want to recreate a script for each. The Dapper docs weren't much help, I found.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      I'm not sure how you originally created the tables. Are you hoping the models will be used to create the tables for you? If so, you would need to use Entity Framework ( th-cam.com/video/qkJ9keBmQWo/w-d-xo.html ). That will take some setup work and it isn't something I recommend if you aren't very familiar with Entity Framework. I would personally recommend going the route of SQL Server Data Tools to build your application database: th-cam.com/video/ijDcHGxyqE4/w-d-xo.html

    • @davemcpherson3346
      @davemcpherson3346 5 ปีที่แล้ว

      @@IAmTimCorey Tim, thanks for the prompt reply. For the tables, I created them just as you described... Database project > Add > Table > enter fields matching Model. This created a .sql file in dbo.Table folder matching the data I entered. Just need to run that on the third-party SQL database, but unclear how to do that. I'll look into SQL Server Data Tools, as you suggest. I used VS SQL Server Object Explorer for local IIS linked SQLExpress database and published the database project... but that won't work for a third-party server, of course.

  • @hthclash1970
    @hthclash1970 6 ปีที่แล้ว +1

    Super clean code, I love it.

  • @ezbytes
    @ezbytes 3 ปีที่แล้ว +2

    Just what I needed to access database. There are kind of articles out there but nothing comes close to it.

  • @oskar5700
    @oskar5700 3 ปีที่แล้ว

    Amazing videos. You made this easily understandable and explained it clearly. Keep up the good videos! :D

  • @waz_boolin6582
    @waz_boolin6582 5 ปีที่แล้ว +1

    Dude you are a lifesaver thanks for the valuable info.

  • @kingkongtv380
    @kingkongtv380 6 ปีที่แล้ว

    I am successful with this video. This is my first time doing web development. 😁

  • @kyleschmitz9677
    @kyleschmitz9677 3 ปีที่แล้ว

    Thank you for holding to the "no plain text passwords in database" rule!

  • @ulviugur3605
    @ulviugur3605 3 ปีที่แล้ว

    Thanks Tim ! Using the same class name for both business and view was a tricky one. I am not sure how that is sorted without using fully qualified name of the classes. Cheers

  • @ThistleBlue
    @ThistleBlue 4 ปีที่แล้ว

    Thanks for the help with this code, very helpful in providing ideas of how to do things for my University course. Just need to implement Update and Delete now.

  • @MegaJagveer
    @MegaJagveer 4 ปีที่แล้ว +1

    I'm new to the C#/.NET ecosystem (coming in from Node.js development). A possible video recommendation would be an Intro to C# Web Development for Node/JavaScript Developers, including comparing and contrasting the benefits of each. I think Node has a lot of hype behind it and is the cool thing nowadays, and a lot of developers have gone through college never even knowing about C#/.NET and only hearing about it in jokes about how it's old and outdated. But having worked with both ecosystems now, I'm starting to see serious benefits and advantages in the C#/.NET ecosystem that alot of the Node devs would appreciate, but they've just never bothered to learn about/ never been taught because everyone just follows whatever the hype is. Especially now with .NET Core, the ecosystem is moving in a very good direction.

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      Thanks, added to the list.

    • @MegaJagveer
      @MegaJagveer 4 ปีที่แล้ว

      @@IAmTimCorey Awesome:)Thanks for all the incredible content!!

  • @Itchymcgee
    @Itchymcgee 5 ปีที่แล้ว

    You a hero Tim!
    Also, a course on making a blog engine would be cool.

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      Thanks for the suggestion!

  • @aritralahiri8321
    @aritralahiri8321 ปีที่แล้ว

    Very Informative and beautifully explained video. Thanks a lot for this.

  • @geezer2450
    @geezer2450 5 ปีที่แล้ว

    Thank you Tim - exactly what I needed!

  • @sunainaarora975
    @sunainaarora975 5 ปีที่แล้ว

    Nicely Explained. Great Video! Thanks Tim.

  • @victorf.6469
    @victorf.6469 3 ปีที่แล้ว

    Really helpful tips and simple teaching.

  • @nickeax
    @nickeax 5 ปีที่แล้ว

    This is a fantastic guide, like all of your videos. Many thanks.

  • @bujin1977
    @bujin1977 6 ปีที่แล้ว

    Very useful, much appreciated. I'm about to start work on a new project which will probably be based on MVC - don't know yet whether to do Core or the old .Net Framework version. The one thing I found confusing here was naming both models the same. I could see that leading to issues if one is not careful. I've seen others name the UI version as a "DTO" (which I think is "data transfer object", but could be wrong - trying to recall from memory here!), so you'd have a data model called "Employee" and the UI model called "EmployeeDto". I think I would prefer to use that style of naming convention. But the tutorial was really good. I'm even considering ditching EF and going with Dapper! I hadn't even heard about it until I started watching your videos.

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      That naming works great. As for full framework vs. .NET Core, both will serve you well. If you have the skills, .NET Core is faster and newer. I'm actually building a site in it (for the community) right now and then I'll be doing a course on it and some TH-cam videos. It took me a while to transition to the new way of thinking though. Definitely not the same as .NET Framework. Lots of little differences (and some big ones).

    • @bujin1977
      @bujin1977 6 ปีที่แล้ว

      @@IAmTimCorey Thanks. I look forward to your course and videos. I have only had a brief look at Core so far, and it's a couple of years since I last built an ASP. NET MVC app. Still weighing up the options. Thankfully, the app I'm building isn't going to be too challenging. I hope...

  • @worlukk
    @worlukk 4 ปีที่แล้ว

    good video. i followed along and recreated the application sans the plural error on the employee(s) table

    • @IAmTimCorey
      @IAmTimCorey  4 ปีที่แล้ว

      Thanks, glad to hear it

  • @dogburrito
    @dogburrito 5 ปีที่แล้ว

    Tested and working. This is the first MVC tutorial of 3 that I've attempted that proved to be 100% valid and effective. Better than PluralSight (which I cancelled today). This code is now working 100%.
    Thanks Tim! This get's me halfway to where I need to be for my first MVC project
    Can you recommend a resource for one or more of these problems?
    1) capture an argument from the URL, like (host/Index/
    2) SQL select a two tier (2 table "header - detail" join) into the model and then display the header and detail data on the view
    3) embed a hyperlink into the above detail records. When licked it reads a PDF file from a file-system and opens it in the browser

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      I don't have a demo of the MVC version of the first question (I do for Razor Pages). For the second question, just do two queries - one for the header, one for the details. Then combine the results into one model. For the third question, that's a bit too specific to answer in a comment, sorry.

  • @rasa7945
    @rasa7945 5 ปีที่แล้ว +2

    Hello Tim, @ 1:10:02, I'm having a different error than yours. 'Object reference not set to an instance of an object.' It's pointing to the ViewEmployees.cshtml at the foreach (var item in Model). Any suggestions, Thanks

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว

      It sounds like you didn't instantiate your Model.

    • @rasa7945
      @rasa7945 5 ปีที่แล้ว

      Thank you for your reply. The mistake was, I didn't pass employees in the return View.

  • @rodrigo6459
    @rodrigo6459 6 ปีที่แล้ว +1

    Any chance you can do something like "Entity Framework (Db 1st and Code 1st with migrations) + ASP.NET MVC In Depth" series?, showing stuff like Eager and Lazy loading... 1 to 1, 1 to many relationships and stuff like that will be GREAT!

    • @IAmTimCorey
      @IAmTimCorey  6 ปีที่แล้ว

      That's a firm maybe. I'm not a big EF guy (I really don't like it for most situations). I've been considering it for the new EFCore stuff since that is so much faster than EF.

    • @rodrigo6459
      @rodrigo6459 6 ปีที่แล้ว

      Will be looking forward for some of that sweet juicy knowledge!! :)

  • @lyubomyr6457
    @lyubomyr6457 3 ปีที่แล้ว +2

    I know that my questions might be a bit late, but I would really appreciate if you could explain me something. Isn't it more convenient just to use Entity Framework for the Data Access instead of typing the Data Library by your own? What's the difference between these 2 approaches? And where exactly was Dapper used? It seems like you have mapped the data between 2 models manually, isn't it?

  • @jean-francoispedneault3632
    @jean-francoispedneault3632 2 ปีที่แล้ว

    This is awsome! Crystal clear! Thank you so much!

  • @francescacedro3501
    @francescacedro3501 5 ปีที่แล้ว

    thank you! you're the best "teacher"!

    • @IAmTimCorey
      @IAmTimCorey  5 ปีที่แล้ว +1

      You are most welcome. Thanks for watching.

  • @Dotto19
    @Dotto19 4 ปีที่แล้ว

    Hi Tim,
    This is very useful. Thank you