title: Why is my Entity Framework connection string not working
body: <p>I am trying to connect to a database without using App.Config but i keep getting the following error: </p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.Data.Entity.Core.EntityException' occurred in EntityFramework.dll</p>
    
    <p>Additional information: The underlying provider failed on ConnectionString.   </p>
  </blockquote>
  
  <p>I can't see where I've gone wrong so i thought i'd ask here.</p>
  
  <pre><code>namespace MyNameSpace
      {
          using System;
          using System.Data.Entity;
          using System.Data.Entity.Core.EntityClient;
          using System.Data.Entity.Infrastructure;
  
          public partial class Entities : DbContext
          {
              public Entities()
                  : base(entityString.ToString())
              {
              }
  
              public static EntityConnectionStringBuilder entityString = new EntityConnectionStringBuilder()
              {
                  Provider = "System.Data.SqlServerCe.4.0",          
                  Metadata = "res://*/RS.csdl|res://*/RS.ssdl|res://*/RS.msl",
                  ProviderConnectionString = @"C:\RestOfPath\database.sdf;Password=3476dfg423434563466e85rcsd"
              };  
  
  
  
          }
      }
  </code></pre>
  
  <p>Thank you in advance for your help.</p>