Stop Visual Studio from using LocalDB during debug
<p>I have a database first EF project in Visual Studio 2013.  I was able to create the Entity Data Model (based on one table in SQL Server) and use the scaffold wizard to create the basic controller and views.</p>

<p>When I ran the Index view in Debug (f5), I saw no records listed, but I have a handful of records in my database.  I tried putting a breakpoint in the controller to see what was happening, but I all I can see when I step through is that no records are being returned:</p>

<pre><code>private KpiAttributeEntities db = new KpiAttributeEntities();

// GET: mfg_n_KpiAttribute
public ActionResult Index()
{
    return View(db.mfg_n_KpiAttribute.ToList()); //no results
}
</code></pre>

<p>So, I decided to use the Create view to see if I could create a new record, which worked successfully.
BUT, that new record is not in my SQL table.  This leads me to believe that VS is not using the SQL instance / database I have set up in webconfig (the one that was used to create the model, controller and views).</p>

<p>I have followed the suggestions here:
<a href="https://stackoverflow.com/questions/29500812/why-does-visual-studio-start-localdb-and-how-can-i-stop-that">Why does Visual Studio start localdb and how can I stop that?</a></p>

<p>Specifically, I made the suggested regedits, and renamed sqlservr.exe in C:\Program Files\Microsoft SQL Server\120\LocalDB\Binn, and rebooted my computer to verify there were no lingering processes.  I don't see any sqlservr processes in taskmgr.  And my production SQL Server instance is the only one showing in VS SQL Server Object Explorer.</p>

<p>But I still see the record I created when I run the Index view in VS, and I do not see the records in my SQL table.</p>

<h2>How do I get VS to use the SQL instance that's specified in webconfig?</h2>

<pre><code>&lt;connectionStrings&gt;
    &lt;add name="KpiAttributeEntities" connectionString="metadata=res://*/Models.KpiAttributeModel.csdl|res://*/Models.KpiAttributeModel.ssdl|res://*/Models.KpiAttributeModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=MyRemoteServer\MyInstance;initial catalog=MyDatabase;persist security info=True;user id=MyUser;password=MyPassword;MultipleActiveResultSets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
 &lt;/connectionStrings&gt;
</code></pre>

<hr>

<p>Update based on comment:</p>

<p>DbContext:</p>

<pre><code>public partial class KpiAttributeEntities : DbContext
{
    public KpiAttributeEntities()
        : base("name=KpiAttributeEntities")
    {
    }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        throw new UnintentionalCodeFirstException();
    }

    public virtual DbSet&lt;mfg_n_KpiAttribute&gt; mfg_n_KpiAttribute { get; set; }
}
</code></pre>