I use a mssql 2008 server (at my webhotel) and I am trying to save data in it from my code.
I have made this little test code here that gives me this error in topic
Context = new XXX_dk_dbEntities();
var vehicle = new Vehicle { Name = "test" };
Context.AddObject("Units", vehicle);
Context.SaveChanges();
EDIT: Changing Context.AddObject(vehicle.GetType().Name, vehicle); to Context.AddObject(“Something”, vehicle); gives the same error, so I think it might be my connectionstring or my EF that needs proper setup, anyway I can test that?
Edit 2: Changed it to Units now which makes my error {“The underlying provider failed on Open.”} and inspecting that gives me this error {“Login failed for user ‘xxxxx_dk’.”} so it must be my connectionstring
<add name="xxxxx_dk_dbEntities" connectionString="metadata=res://*/Areas.Units.UnitsModel.csdl|res://*/Areas.Units.UnitsModel.ssdl|res://*/Areas.Units.UnitsModel.msl;provider=System.Data.SqlClient;provider connection string="data source=mssql1.unoeuro.com;initial catalog=xxxxxxx_dk_db;persist security info=True;user id=xxxxxxxx_dk;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
This is the solutionexplore showing my edmx structure 


After I found I had to add the remove (For some reason it uses a connectionstring specified in machine.config) and changed the name of my own provider to “AspNetSqlMembershipProvider” I created a new connectionstring for this to use so remove old connectionstring (Wierd!), create a custom memberprovider like
And then make a connectionstring only for this