<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Randle Kehinde Olanrewaju</title>
    <description>The latest articles on DEV Community by Randle Kehinde Olanrewaju (@randlelanre).</description>
    <link>https://dev.to/randlelanre</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F230227%2Fd9de80a1-6c3c-4b20-acaf-06f32046cb3a.png</url>
      <title>DEV Community: Randle Kehinde Olanrewaju</title>
      <link>https://dev.to/randlelanre</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/randlelanre"/>
    <language>en</language>
    <item>
      <title>Connecting your ASP.NET core application to a local instance of SQLServer</title>
      <dc:creator>Randle Kehinde Olanrewaju</dc:creator>
      <pubDate>Sun, 10 May 2020 15:24:23 +0000</pubDate>
      <link>https://dev.to/randlelanre/connecting-your-asp-net-core-application-to-a-local-instance-of-sqlserver-21l9</link>
      <guid>https://dev.to/randlelanre/connecting-your-asp-net-core-application-to-a-local-instance-of-sqlserver-21l9</guid>
      <description>&lt;p&gt;It is no news that one of the best databases to use for asp.net/.net development is SqlServer because of its smooth integration provided with .net(ASP.NET/UWP/Winforms/Xamarin) applications.&lt;/p&gt;

&lt;p&gt;Let's get to the process of integrating a local Instance of SqlServer with our our ASP.NET application.....&lt;/p&gt;

&lt;p&gt;For you to complete these steps you would need the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Microsoft SQL server management studio&lt;/li&gt;
&lt;li&gt;SqlServer  configuration manager&lt;/li&gt;
&lt;li&gt;An ASP.NET project (with EFCore ORM for sqlserver installed )&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;To install EFcore tools with sqlserver &lt;br&gt;
go to &lt;code&gt;package manager console&lt;/code&gt; and install the following package&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  Microsoft.EntityFrameworkCore.SqlServer
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;p&gt;step 1.&lt;/p&gt;

&lt;p&gt;open SqlServer configuration manager &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3rokm5alux4njtr6ve0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3rokm5alux4njtr6ve0u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;make sure TCP/IP is enabled if this is your first time using a local instance/or connecting to your sqlserver remotely, then right click on TCP/IP and select properties, then select IP addresses, then scroll down to the last section which says &lt;code&gt;Ipall&lt;/code&gt; and enter the &lt;code&gt;TCP port:1433&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;Step2:&lt;/p&gt;

&lt;p&gt;Step 2 is to create a database in your Sqlserver management studio that you intend to use for your asp.net project.&lt;/p&gt;

&lt;p&gt;Step 3: is to add the database as your connection string in your &lt;code&gt;appsettings.json&lt;/code&gt; file(in your asp.net project). replace &lt;code&gt;DATABASENAME&lt;/code&gt; with the name of your database&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"ConnectionStrings": {&lt;br&gt;
    "DefaultConnection": "Data Source=.;Initial Catalog=DATABASENAME;Integrated Security=True"&lt;br&gt;
  }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;step4: &lt;/p&gt;

&lt;p&gt;Create an ApplicationDBcontext class in your project &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj9832wb6cegsage7cbc1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fj9832wb6cegsage7cbc1.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and add the dbcontext to your application start-up class under the configure services &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuvrpsisvkaxb6ccbnf8j.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fuvrpsisvkaxb6ccbnf8j.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and you should be up and running ..... 😄&lt;/p&gt;

</description>
      <category>aspnetcore</category>
      <category>sqlserver</category>
      <category>efcore</category>
    </item>
  </channel>
</rss>
