i have created database use nuget gallery implementation. can see database in sql manager 2012 , can access test program wrote, using connection string. however, when try run update-database command in package manager console, have ef set database, keep getting error: "the server not found or not accessible.".
here's more detail:
pm> update-database -verbose using startup project 'nugetgallery.operations'. using nuget project 'nugetgallery'. specify '-verbose' flag view sql statements being applied target database. system.data.providerincompatibleexception: error occurred while getting provider information database. can caused entity framework using incorrect connection string. check inner exceptions details , ensure connection string correct. ---> system.data.providerincompatibleexception: provider did not return providermanifesttoken string. ---> system.data.sqlclient.sqlexception: network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) @ system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection, action`1 wrapcloseinaction) @ system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj, boolean callerhasconnectionlock, boolean asyncclose)
here's connection string in nuget gallery mvc site:
<add name="gallery.sqlserver" connectionstring="server=(localdb)\v11.0;database=nugetgallery11;user id=testuser;password=notmyrealpassword;connect timeout=60" providername="system.data.sqlclient"/>
and here's test program. connection strings identical in both applications.
var sqlconnection2 = new sqlconnection(configurationmanager.connectionstrings["gallery.sqlserver"].connectionstring); sqlconnection2.open(); using (sqlconnection2) { var sqlcmd = new sqlcommand("select * foo", sqlconnection2); var foo = sqlcmd.executereader(); while (foo.read()) { int id = foo.getint32(0); var name = foo.getstring(1); var email = foo.getstring(2); console.writeline("id:{0}, name:{1}, email:{2}", id, name, email); } } console.read();
any appreciated. thanks!
my problem solved in other post here. have set default project in manager console , set startup project solution in order update command find connection string , aydin said, in case part set me.