title: Cannot create database with Code-First
body: <p>I am using Visual Studio 2015, Entity Framework v6, and SQL Server 2016 Express. In the past I created a database using a <code>SqlConnection</code> and <code>SqlCommand</code> and stuff the SQL into a string.</p>
  
  <p>Now, I am teaching myself EF6 on <a href="http://www.entityframeworktutorial.net/code-first/simple-code-first-example.aspx" rel="nofollow noreferrer">Entity Framework Tutorial</a>. On the simple code-first example (very simple), I literally copy and paste my code but still do not see the database created in SSMS. Neither does my code throw me any error. </p>
  
  <p>Instead of pasting the code, I did a screenshot. I hope someone can point out what I am or the tutorial is missing.</p>
  
  <p><a href="https://i.stack.imgur.com/BBc5a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BBc5a.png" alt="enter image description here"></a></p>
  
  <p>［EDIT]
  Following Sampath's suggestion, I end up getting the following error:
  <a href="https://i.stack.imgur.com/eUDBA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eUDBA.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/rWWtj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rWWtj.png" alt="enter image description here"></a></p>
  
  <p><strong>[EDIT - Solved, sort of]</strong></p>
  
  <p>I apply the same code to another machine of same setup and the code works. So I suspect there are some corruption in the SQL Server or perhaps some registry is incorrect. I uninstall EVERY SQL Server version and related tools, delete all folders and files manually, then freshly reinstall SQL Server Express 2016 and tools. Then my code works. </p>
  
  <p>I don't see this as a solution, but if someone can suggest what may have cause this problem I will try to recreate it or post a real solution to it.</p>