(#45) Generate database using entity framework core CLI | add table, column | Asp.Net Core tutorial

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 64

  • @pp-zc4to
    @pp-zc4to 4 роки тому

    thanks pl go ahead. your tutorials are very easy and clean to understand.

  • @manishdeshpande
    @manishdeshpande 3 роки тому

    👍🏻 Lovely presentation

  • @chrismills4549
    @chrismills4549 4 роки тому +13

    get-help entityframework fails
    to fix this problem
    add package Microsoft.EntityFrameworkCore.Tools

    • @felixlara3017
      @felixlara3017 4 роки тому

      I was having the same trouble, thank you so much for help

    • @AbhinavKumardns
      @AbhinavKumardns 4 роки тому

      thanks a lot!!

    • @ytkids8
      @ytkids8 Рік тому

      This packing was missing in my case. Thanks

  • @vinaydeveloper1369
    @vinaydeveloper1369 4 роки тому

    very useful this video tutorials

  • @raulguzman1964
    @raulguzman1964 3 роки тому

    Nice video! Thanks!

  • @rayt6867
    @rayt6867 4 роки тому +4

    Hello, I used this command to create the migrations folder in the data folder, this took me a while to figure out, I hope is helpful to others:
    Add-Migration InitialCreate -OutputDir Data\\Migrations

  • @thesomesh4u
    @thesomesh4u 3 роки тому

    Dear Sir,
    I have pre existing sql database, is there any video to teach how use connect with existing DB

  • @sahaniarunitm
    @sahaniarunitm 4 роки тому +1

    appreciate

  • @MuHammadUmaIr-ph2jc
    @MuHammadUmaIr-ph2jc Рік тому

    this Error Occur when i enter update-database
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

  • @AdnanUlHaqCA
    @AdnanUlHaqCA 4 роки тому

    how to handle this :A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    • @WebGentle
      @WebGentle  4 роки тому

      You have entered a wrong database connection string.

    • @AdnanUlHaqCA
      @AdnanUlHaqCA 4 роки тому

      Thank you for the reply. I used . For the local server and copied the same pattern you gave. How to check this and fine the right one?

    • @iamservantofallah-Jannah
      @iamservantofallah-Jannah 4 роки тому +1

      @@AdnanUlHaqCA "Server=ZAKI" + @"\"+ "Omar;Database=BookStore;Integrated Security=True;"

  • @arafatrahman5165
    @arafatrahman5165 3 роки тому

    In my Case, When I use "Update-Database" , it says "Keyword not supported: 'integrated secuirity" . What should I do?

  • @palakshah5222
    @palakshah5222 3 роки тому

    hello nitish i need to migrate my database to code so how i can?i have multiple project in single solution ? can you help me?

  • @TaurasGirl
    @TaurasGirl 4 роки тому +1

    The update-database command runs successfully, but it doesn't create the database? Why is it so? Could you help it out please, I searched over the net but couldn't find helpful solution so far.

    • @WebGentle
      @WebGentle  4 роки тому

      Make sure you have a valid connection string. You can also download the code of this project from GitHub and try to compare with your code.

    • @TaurasGirl
      @TaurasGirl 4 роки тому

      @@WebGentle the connection is valid, I verified it. Can I use scaffold dB context command?

    • @WebGentle
      @WebGentle  4 роки тому

      You need to use add-migration command before using update-database

    • @AdnanUlHaqCA
      @AdnanUlHaqCA 4 роки тому

      facing the exact same problem

    • @AdnanUlHaqCA
      @AdnanUlHaqCA 4 роки тому

      A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

  • @vishnuc4661
    @vishnuc4661 2 роки тому

    actually im using MAC Os i did not get the package manager console

  • @IBEXPRESS
    @IBEXPRESS 4 роки тому

    Hi While Migration i am getting this error
    The specified deps.json [E:\Bookstore\Bookstore\Bookstore\Bookstore.deps.json] does not exist
    what is solution

  • @SoftwareDevelopmentUIBackend
    @SoftwareDevelopmentUIBackend 3 роки тому

    How can we work on multiple tables using entity framework

  • @dkmr996
    @dkmr996 2 роки тому

    Hello, i am facing issue while running update database command
    PM> update database
    update : The term 'update' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + update database
    + ~~~~~~
    + CategoryInfo : ObjectNotFound: (update:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    • @dkmr996
      @dkmr996 2 роки тому

      resolved by using update-database

  • @AdnanUlHaqCA
    @AdnanUlHaqCA 4 роки тому

    what is the error in this connection string?
    services.AddDbContext(Options => Options.UseSqlServer("Server=.;Integrated Security=True;"));
    i tried this as well services.AddDbContext(
    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
    This is my server address DESKTOP-7N1IAQU\SQLEXPRESS

    • @WebGentle
      @WebGentle  4 роки тому

      You have not mentioned the database name in the connection string

    • @AdnanUlHaqCA
      @AdnanUlHaqCA 4 роки тому

      Yes i tried the database name too and dot too. Nothing works unfortunately. I checked entire sql and enabled services as well. Don't know what's the issue.

    • @WebGentle
      @WebGentle  4 роки тому +1

      Use db name and DESKTOP-7N1IAQU\SQLEXPRESS in the server in place of dot (.).

    • @AdnanUlHaqCA
      @AdnanUlHaqCA 4 роки тому

      @@WebGentle i used that too and it shows red underline under \ sign nd doesn't work unfortunately.

    • @AdnanUlHaqCA
      @AdnanUlHaqCA 4 роки тому

      @@WebGentle problem resolve. I just added two \\ instead of one \ and it worked. It was considering one \ as escape i think.

  • @gauravsaini45k91
    @gauravsaini45k91 3 роки тому

    Add-migration build faild please resolve this problem

  • @HeelsOnTheHills
    @HeelsOnTheHills 4 роки тому

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) .
    I'm getting this while updating database. Can anyone please help?

    • @WebGentle
      @WebGentle  4 роки тому +1

      Make sure you are using a correct db connection string and you have the permission of the db.

    • @HeelsOnTheHills
      @HeelsOnTheHills 4 роки тому

      @@WebGentle Finally working after enabling services, protocols and server properties.Tysm :)

    • @mahnoorali7354
      @mahnoorali7354 2 роки тому

      @@HeelsOnTheHills how you checked it?

  • @prajnadash405
    @prajnadash405 4 роки тому +1

    When i wrote the command add-migration it was not ask to install Microsoft.EntityFrameworkCore.Design package.
    And the migration was successful

    • @WebGentle
      @WebGentle  4 роки тому

      You might have already installed it in your project. You can verify it by expanding dependencies- nuget

    • @prajnadash405
      @prajnadash405 4 роки тому +1

      @@WebGentle When the error not came i have checked,it was not there.

  • @DevilkiLLEr-ze8ye
    @DevilkiLLEr-ze8ye Рік тому

    i will getting error in update-database

  • @abubakaribrahim2676
    @abubakaribrahim2676 4 роки тому

    Hello, I added migration and updated database but sqlserver or database is not showing there. Someone should help please

    • @shivampandya763
      @shivampandya763 3 роки тому

      i also face this problem if you get a soluation so please tell me how it's solve.

  • @amitkishor7338
    @amitkishor7338 4 роки тому

    if I delete Migrations file that automatically generates DateTime then any problem come to project

    • @WebGentle
      @WebGentle  4 роки тому +1

      No. You can delete the file. Use add migration and create / update database. Everything will work

  • @jitendrakumar-wv7sd
    @jitendrakumar-wv7sd 4 роки тому

    get-help entityframework not working.Please help.
    After installing Tools it is working. No problem.

  • @rakibulalam7166
    @rakibulalam7166 3 роки тому

    I am facing the error below:
    PM> Add-Migration init
    Add-Migration : The term 'Add-Migration' is not recognized as the name of a cmdlet, function, script file, or
    operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
    try again.
    At line:1 char:1
    + Add-Migration init
    + ~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Add-Migration:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

  • @pp-zc4to
    @pp-zc4to 4 роки тому

    sir i am unable to access your further video. pl sir open it for all subscribers 🙏🙏🙏🙏

  • @adnanmohamed6517
    @adnanmohamed6517 4 роки тому +1

    For anyone getting this error:
    error: 40 - Could not open a connection to SQL Server) when connecting to local database
    I faced this error after entering the command Update-Database. I solved it by changing the string inside the method services.AddDbContext(options =>
    options.UseSqlServer("Server= . ;Database=Bookstore; Integrated Security=True;")
    );
    You should make sure that the server name is the same (mine was not dot(.)) so I got that error. You can see the server name appearing on the top in Microsoft SQL Server Manager.

  • @amitkishor7338
    @amitkishor7338 4 роки тому

    Sir how to generate entity framework edmx

    • @WebGentle
      @WebGentle  4 роки тому +1

      Dear Amit, There is no edmx file in ef core

    • @amitkishor7338
      @amitkishor7338 4 роки тому

      @@WebGentle sir can we use Database First approach

    • @WebGentle
      @WebGentle  4 роки тому +1

      @@amitkishor7338 Yes database first approach is possible in efcore.

    • @amitkishor7338
      @amitkishor7338 4 роки тому

      @@WebGentle plz make on video on this

  • @akhilgarg9753
    @akhilgarg9753 Рік тому

    get-help entityframework command is not worrking