Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 27, 2012 08:43 PM by ryanbesko
Participant
845 Points
244 Posts
Jun 27, 2012 08:24 PM|LINK
i get this error Cannot open database "DataLayer.Context.MedicallexiconContext" requested by the login. The login failed. Login failed for user 'CL-xcsd-\medicallexicon_web'. this is my context
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); }}
and this is my connection string
<add name="MedicallexiconContext" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MedicallexiconProject-2012615153521;Integrated Security=True" providerName="System.Data.SqlClient"/>
and this is my database name DataLayer.Context.MedicallexiconContext
Contributor
3561 Points
619 Posts
Jun 27, 2012 08:43 PM|LINK
See my answer on this thread:
http://forums.asp.net/t/1769531.aspx/1?help+with+connection+string+for+newly+created+database+in+SQLExpress
MohammadJafa...
Participant
845 Points
244 Posts
Login failed for user '\medicallexicon_web'. Codefirst
Jun 27, 2012 08:24 PM|LINK
and this is my connection string
and this is my database name DataLayer.Context.MedicallexiconContext
ryanbesko
Contributor
3561 Points
619 Posts
Re: Login failed for user '\medicallexicon_web'. Codefirst
Jun 27, 2012 08:43 PM|LINK
See my answer on this thread:
http://forums.asp.net/t/1769531.aspx/1?help+with+connection+string+for+newly+created+database+in+SQLExpress