Null reference error

Jan 27, 2012 at 6:57 PM
Edited Jan 27, 2012 at 6:59 PM

I am getting a null error when I run this:

public const string ConnectionString = "name=SettingEntities

public const string ContainerName = "SettingEntities"; #region Constructors
public SettingEntities(string tablePrefix):base (ConnectionString, ContainerName,
    new BrandonHaynes.ModelAdapter.EntityFramework.ConnectionAdapter(
this.ContextOptions.LazyLoadingEnabled = true;


Here is my web.config

add name="SettingEntities" connectionString="metadata=res://*/Settings.csdl|res://*/Settings.ssdl|res://*/Settings.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=XXXXXX;initial catalog=CCCCCC;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" /> </commectionStrings>

Any ideas? Thanks,

Feb 9, 2012 at 10:51 AM

I've got the same problem

Jun 26, 2012 at 10:12 AM

It's a possible error if you have tables without primary key.

I've fixed that by adding primary key manually (database first) even if Entity framework add automatically primary keys if does not exists.

Good luck,

Hope it help

Aug 13, 2012 at 8:41 AM

Another solution is to import the all project files instead of unique dll