(#61) Get and save dropdown data in database | Asp.Net Core tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • Asp.net core tutorial: We will get the data of dropdown from the database and will save the value of the selected option to the database in asp.net core. By now in this tutorial, we were using hardcoded values for dropdowns now we will make it dynamic.
    To get the dropdown data from database we will add a new table, will map it to the main table, and finally using entity framework core we will get the data.
    #DynamicDropdown #DropdownWithDatabase #Nitish
    Join this channel to get access to perks:
    / @webgentle
    GitHub Repo: github.com/web...
    Subscribe WebGentle: goo.gl/PJr1pN
    Visit Our Website: webgentle.com
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    For business inquiry contact: nitish.webgentle@gmail.com
    Follow us on
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Facebook - bit.ly/36yZuQN
    Linkedin - bit.ly/2N6Onqk
    Twitter - bit.ly/2uv04AP
    Popular free courses from WebGentle
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Jira tutorial - bit.ly/jiratuto...
    Asp.Net Core Tutorial: bit.ly/aspnetco...
    Azure DevOps tutorial - bit.ly/azuredev...
    .NET Core 3.0 fundamentals - bit.ly/dotnetcore3
    MVC5 tutorial - bit.ly/mvcbynitish
    LINQ Tutorial - bit.ly/linqbyni...
    Non generic collection in c# - bit.ly/nongener...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 27

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

    Super, Just finished all the videos and you are amazing!..Simple, detailed, short explanation. Thanks alot.
    Egarly waiting for next videos!

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

    Thank you very much sir, this video really helpful for me .

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

    ThankYou Sir For this Playlist It help me alot for my study and project

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

    Hello! So in the previous video, you removed multi-select to use enums and you've carried on using single-select. In the video that you covered multi-select, you didn't cover how to send that new data to the database- the database was still receiving the singular string value. Would you be happy to cover that?

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

    This video very helpful sir ji 🙏🙏🙏

  • @ayan.kemel7
    @ayan.kemel7 3 ปีที่แล้ว +1

    Hello, please help me. There was such an error :
    An unhandled exception occurred while processing the request.
    NullReferenceException: Object reference not set to an instance of an object.
    Webgentle.BookStore.Controllers.BookController.AddNewBook(bool isSuccess, int bookId) in BookController.cs, line 46
    NullReferenceException: Object reference not set to an instance of an object.
    Webgentle.BookStore.Controllers.BookController.AddNewBook(bool isSuccess, int bookId) in BookController.cs
    +
    ViewBag.Language = new SelectList(await _languageRepository.GetLanguages(), "Id","Name");
    lambda_method(Closure , object )

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

    Great job for the good work. After watching and implement this lesson i continue to get this error when adding new book
    SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Books_Language_LanguageId". The conflict occurred in database "BookStore", table "dbo.Language", column 'LanguageId'. The statement has been terminated.

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

      Hey, I was getting a similar error when I was trying to add a migration for the table. I fixed this by removing any existing data in the tables then adding a new migration and updating the database.

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

    Hi Nitish, your videos are very helpful and informative. can you please upload video on Bind DropDownList and DropDownList based on another DropDownList selected value in ASP.NET CORE 3.1

  • @SaurabhKumar-om2gz
    @SaurabhKumar-om2gz 2 ปีที่แล้ว

    Is it fine to Change Model Randomly also instead of using multiple model for different Operation Can we use ViewModel. Its very informative but implementation is bit Complicated.

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

    HI Nitish sir you video very information and useful but sir I have one question
    edit mode cascading dropdownlist in asp.net core mvc
    exam dropdown1 value 1 and dropdown2 how can be set from database

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

    i Have followed every step and getting below error plz reproduce and guide why i am getting this
    NullReferenceException: Object reference not set to an instance of an object.
    Microsoft.AspNetCore.Mvc.Rendering.MultiSelectList.GetListItemsWithValueField()

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

    really good

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

    Please cover Dropdown using ViewModel instead of using ViewData or ViewBag also.

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

      Instead of using viewbag you can pass the data in model property and use your model property on view in asp-items attribute. Rest everything will be same.

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

    Master Nitish are you going to add globalization to this app? that would be awesome.

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

      Good idea. Definitely will try

  • @Mahesh-ox6sn
    @Mahesh-ox6sn 4 ปีที่แล้ว

    Hi Nitish, your videos are very helpful and informative. can you please upload video on Azure SSO ( single sign on). and how to configure SSO from visual studio?

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

    Why 14:57 Id = 0 without error while my code returns view

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

    It shows BookStore.models.BookLanguage in all the drop drown items instead of languages . why ?

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

      Problem solved . I forget to pass second and third parameter in SelectList()

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

    repository concept is a such hard thing to learn

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

    System.NullReferenceException: 'Object reference not set to an instance of an object.'
    Bookstore.Data.Book.language.get returned null when getaallbooks
    in getallbook methos I had too add this line to fix it
    book.language =await _db.langtable.Where(x => x.id == book.languageId).FirstOrDefaultAsync();

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

      I am getting same error in Droplist binding don't know what is the issue

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

    This method is too tough kindly use it as to make it easy ,

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

    useless, Greate concepts but 0 following potential