0
votes

I'm very new to setting up a SQL Server database and connecting to it (Visual Studio 2012 for Web). I've downloaded SQL Server 2014 and I have SQL Server (Express) running in my services.

I'm clueless as to what my next step should be, I've setup a data connection in the Database Explorer view using the SQL Server Express but when I try to update-database in my Package Manager Console I get

The provider did not return a ProviderManifest instance

which could be because my connection string is wrong.

Connection string:

<add name="DefaultConnection" 
     connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=RecreationalServices;Integrated Security=False" 
     providerName="System.Data.SqlClient" />

Check IMAGE CLICK HERE

Error code in full text

PM> update-database

No pending code-based migrations.
System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifest instance. ---> System.ArgumentException: Could not determine storage version; a valid storage connection or a version hint is required.
at System.Data.SqlClient.SqlVersionUtils.GetSqlVersion(String versionHint)
at System.Data.SqlClient.SqlProviderManifest..ctor(String manifestToken)
at System.Data.SqlClient.SqlProviderServices.GetDbProviderManifest(String versionHint)
at System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken)
--- End of inner exception stack trace ---
at System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken)
at System.Data.Metadata.Edm.StoreItemCollection.Loader.InitializeProviderManifest(Action3 addError)
at System.Data.Metadata.Edm.StoreItemCollection.Loader.OnProviderManifestTokenNotification(String token, Action
3 addError)
at System.Data.EntityModel.SchemaObjectModel.Schema.HandleProviderManifestTokenAttribute(XmlReader reader)
at System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader reader)
at System.Data.EntityModel.SchemaObjectModel.SchemaElement.ParseAttribute(XmlReader reader)
at System.Data.EntityModel.SchemaObjectModel.SchemaElement.Parse(XmlReader reader)
at System.Data.EntityModel.SchemaObjectModel.Schema.HandleTopLevelSchemaElement(XmlReader reader)
at System.Data.EntityModel.SchemaObjectModel.Schema.InternalParse(XmlReader sourceReader, String sourceLocation)
at System.Data.EntityModel.SchemaObjectModel.Schema.Parse(XmlReader sourceReader, String sourceLocation)
at System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList1& schemaCollection)
at System.Data.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable
1 xmlReaders, IEnumerable1 sourceFilePaths)
at System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable
1 xmlReaders, IEnumerable1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerManifestToken, Memoizer2& cachedCTypeFunction)
at System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable1 xmlReaders)
at System.Data.Entity.Migrations.Extensions.XDocumentExtensions.GetStoreItemCollection(XDocument model, DbProviderInfo& providerInfo)
at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, String connectionString)
at System.Data.Entity.Migrations.DbMigrator.IsModelOutOfDate(XDocument model, DbMigration lastMigration)
at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable
1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore() at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run() The provider did not return a ProviderManifest instance.

2
If IntegratedSecurity is false you must supply User Id and Password attributes.Crowcoder
There are lot of tutorial for this. Just google it for mvc ef tutorialJuan Carlos Oropeza
@JuanCarlosOropeza Of course I know how to google. Most of them want you to use a local database first which I don't want to do.TykiMikk
@Crowcoder IntegratedSercurity doesn't work. Where do i enter the userID and password? I don't think I have anyTykiMikk
I didnt say you dont know how to google. I say instead of asking us to teach you how work with EF, you should be following a tutorial first. Then when you have a problem you can ask. Also you say you dont want use a local db and that is the one you are using? Check this one connectionstrings.com/sql-server for every string connection. Did you try connect from SQL Studio first?Juan Carlos Oropeza

2 Answers

0
votes

Try to change Integrated Security from False to True.