How To Connect SQL Database in ASP .NET Standard

  • rayhan 

 

Steps of Database Connection:

Steps are mentioned bellow-

1. Install Entity Framework: To install the necessary packages, needed to go- Tools -> NuGet Package -> Package Manager

Run the bellow three packages in ‘Package Manager Console’

1. Install-Package Microsoft.EntityFrameworkCore.SqlServer

2. Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design

3. Install-Package Microsoft.EntityFrameworkCore.Tools

Tools -> NuGet Package -> Package Manager Console

In Console Write

  1. add-migration   then   write  model name
  2. update-database

Then Check database .You see that new table will be createsuccessfully.Sometimes need to refresh .So,refresh and check table is created or not.

Hope you will create connection .

Happy Coding …

Md.Mohoin Miah

 

Leave a Reply

Your email address will not be published. Required fields are marked *