实体框架包迁移问题

时间:2013-06-16 15:24:51

标签: asp.net-mvc-4 ef-migrations

我正在尝试为我的MVC应用程序迁移实体。我对此非常陌生,对.NET MVC知之甚少。我遇到的问题是,当我运行迁移时,我收到错误“Keyword not supported:'userid'”。我不知道他指的是“用户名”。有人能指出我的迁移工作原理,以便我可以找出它在错误中引用的“用户ID”吗?

非常感谢!

  

启用 - 迁移--ContextTypeName BBGDB检查上下文   以现有数据库为目标... System.ArgumentException:不是关键字   支持:'userid'。在   System.Data.Common.DbConnectionOptions.ParseInternal(哈希表   parsetable,String connectionString,Boolean buildChain,Hashtable   同义词,布尔值firstKey)at   System.Data.Common.DbConnectionOptions..ctor(String connectionString,   Hashtable的同义词,Boolean useOdbcRules)at   System.Data.SqlClient.SqlConnectionString..ctor(字符串   connectionString)at   System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(字符串   connectionString,DbConnectionOptions上一页)at   System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey   key,DbConnectionPoolGroupOptions poolOptions,DbConnectionOptions&   userConnectionOptions)at   System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey   关键)at   System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)   在   System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings   appConfigConnection)at   System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(字符串   name,AppConfig config)at   System.Data.Entity.Internal.LazyInternalConnection.Initialize()at   System.Data.Entity.Internal.LazyInternalConnection.get_Connection()
  在System.Data.Entity.Internal.LazyInternalContext.get_Connection()
  在System.Data.Entity.Infrastructure.DbContextInfo..ctor(Type   contextType,DbProviderInfo modelProviderInfo,AppConfig config,   DbConnectionInfo connectionInfo)at   System.Data.Entity.Infrastructure.DbContextInfo..ctor(类型   contextType)at   System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration   配置,DbContext usersContext)at   System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration   配置)   System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration   migrationsConfiguration)at   System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.RunCore()   在System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()   不支持关键字:'userid'。

1 个答案:

答案 0 :(得分:0)

听起来它指的是默认连接字符串中的userid。检查您的连接字符串并将用户ID替换为用户ID。

相关问题