c# - SQL Server and EF Migration from local to remote database -
i'm working on entity framework (ef) project functions supplemental class library project within visual studio 2013 solution. had mock local database on client dev system , build out schema , other utilities there. data adapter i'm using uses sql authentication.
once had validated stable build satisfied requirements, incorporated ef project solution. working off of local database, worked fine. re-aimed ef database remote sql server by:
- updating data adapter remote server
- successfully testing data adapter's connection
- updating
app.configfiles in start-up project , ef project correct connection string - ran t-sql script generated ef on remote server
- validated t-sql script worked observing database view , seeing new tables present
once finished, re-ran solution. ef threw exception on first call framework:
an unhandled exception of type 'system.data.entity.core.entityexception' occurred in entityframework.sqlserver.dll
additional information: underlying provider failed on open.
when checked inner-exception, found this:
login failed. login untrusted domain , cannot used windows authentication.
this exception puzzles me because if you'll recall @ beginning of post, i'm using sql authentication.
i'm not using asp.net related, testbed being executed console application had no problems pre-migration.
i want administration/environment issue, not code because locally have no issues , t-sql script seems run fine on remote server, , have connectivity it. unfortunately me sql server skills no near coding ability, i'm unable "prove" it. find myself @ loss.
any fine folks @ stackoverflow appreciated!
appended:
per drewjordan:
context constructor -
public databasecontext(): base("name=databasecontext") {} connection string -
connectionstring="metadata=res:///database.csdl|res:///database.ssdl|res://*/database.msl;provider=system.data.sqlclient;provider connection string="data source=mycompany.com\sqlexpress;initial catalog=sandbox2_db;integrated security=true;multipleactiveresultsets=true;app=entityframework"" providername="system.data.entityclient"
you have turned windows authentication on setting integrated security=true; change integrated security=false; or can remove field altogether.
source: 2 hours of bug hunting on past project. here msdn reference
Comments
Post a Comment