我收到此错误无法打开登录请求的数据库“DataLayer.Context.MedicallexiconContext”。登录失败。用户 'CL-xcsd-\medicallexicon_web' 登录失败。这是我的背景
public class MedicallexiconContext : MyDbContextBase, IUnitOfWork
{
public DbSet<Word> Word { get; set; }
public DbSet<Category> Category { get; set; }
public DbSet<Language> Language { get; set; }
public DbSet<Picture> Picture { get; set; }
public DbSet<RelationshipBetweenWords> RelationshipBetweenWords { get; set; }
#region IUnitOfWork Members
#region IUnitOfWork Members
public new IDbSet<TEntity> Set<TEntity>() where TEntity : class
{
return base.Set<TEntity>();
}
#endregion
#endregion
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Configurations.Add(new CategoryConfig());
modelBuilder.Configurations.Add(new WordConfig());
modelBuilder.Configurations.Add(new PictureConfig());
modelBuilder.Configurations.Add(new LanguageConfig());
modelBuilder.Configurations.Add(new RelationshipBetweenWordsConfig());
base.OnModelCreating(modelBuilder);
}
}
这是我的连接字符串
<add name="MedicallexiconContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MedicallexiconProject-2012615153521;Integrated Security=True" providerName="System.Data.SqlClient"/>
这是我的数据库名称 DataLayer.Context.MedicallexiconContext