Results 1 to 2 of 2

Thread: Error on creating Database Controller

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Unhappy Error on creating Database Controller

    HI

    I am a beginner in VS2012 ASP.net MVC. I am trying to do a page for Login with Database. and i have created a model with the following code
    HTML Code:
    public class UserMain
        {
            public class UserMaintenance
            {
                public int UserID { get; set; }
                public string UserName { get; set; }
                public string Email { get; set; }
               
            }
            public class ConnLogin : DbContext 
            {
                public DbSet<UserMaintenance> UserMaintenance { get; set; }
            }
        }
    and from this am trying to create a controller but it displays the following error.

    HTML Code:
    'Login.Models.Usermain' is not part of the specified 'Login.Models.Usermain+ConnLogin' Class, and the 'Login.Models.Usermain+ConnLogin' class couldnt be modified to add a 'Dbset<Login.Models.UserMain>' property to it. (For example, the 'Login.Modeules.UserMain+ConnLogin' class might be in a compiled assemply.)
    Please help me...i am stuck here for two days....

  2. #2
    Frenzied Member MattP's Avatar
    Join Date
    Dec 2008
    Location
    WY
    Posts
    1,227

    Re: Error on creating Database Controller

    Your class seems to imply that it's called UserMain but the error message states that it's Usermain.
    This pattern in common to all great programmers I know: they're not experts in something as much as experts in becoming experts in something.

    The best programming advice I ever got was to spend my entire career becoming educable. And I suggest you do the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width