none
Linking ASP.NET Identity Tables with existing user table RRS feed

  • Question

  • Hi,

    I am working on migrating an asp.net web forms application to a MVC application using asp.net Identity tables.I already have a database present from my web forms app which I have to use along with the identity tables. So the user details for the app is stored in a userprofile table where an attribute named "id" (which is an identity column) is the primary key. Since I have implemented the asp.net identity in the mvc app, I need to check whether the users who have registered and are present in aspnetusers table (identity table) are also present in the userprofile table. So basically I need a foreign key referencing the userprofile table in the aspnetusers table. I have already created an additional identity column in aspnetusers table but I am not able to link it with the userprofile table. I tried creating a foreign key but I am getting errors in the update script as follows:

    SQL71501 :: Procedure: [dbo].[hnp_qGetUsersNew] has an unresolved reference to object [dbo].[UserProfile].[access_key].
    SQL71501 :: Procedure: [dbo].[hnp_qGetUsersNew] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[ProgramStatusLog].[up]::[access_code], [dbo].[UserProfile].[access_code] or [dbo].[UserProfile].[up]::[access_code].
    SQL71501 :: Procedure: [dbo].[hnp_GetSignupEIP] has an unresolved reference to object [dbo].[UserProfile].[access_key].
    SQL71501 :: Procedure: [dbo].[hnp_GetSignupEIP] has an unresolved reference to object [dbo].[UserProfile].[access_code].
    SQL71501 :: Procedure: [dbo].[GetLogin] has an unresolved reference to object [dbo].[UserProfile].[access_key].
    SQL71501 :: Procedure: [dbo].[GetLogin] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [dbo].[HinmanExtended].[access_code], [dbo].[ListProgramStatus].[access_code], [dbo].[ProgramStatusLog].[access_code], [dbo].[UserProfile].[access_code] or [dbo].[UserProfileSupplement].[access_code].
    SQL71558 :: The object reference [dbo].[UserProfile].[Firstname] differs only by case from the object definition [dbo].[UserProfile].[FirstName].
    SQL71558 :: The object reference [dbo].[HinmanExtended].[studyaterm] differs only by case from the object definition [dbo].[HinmanExtended].[StudyATerm].
    SQL71558 :: The object reference [dbo].[HinmanExtended].[studyayear] differs only by case from the object definition [dbo].[HinmanExtended].[StudyAYear].
    SQL71558 :: The object reference [dbo].[HinmanExtended].[studyAloc] differs only by case from the object definition [dbo].[HinmanExtended].[StudyALoc].
    SQL71558 :: The object reference [dbo].[UserProfile].[UserName] differs only by case from the object definition [dbo].[UserProfile].[Username].
    SQL71558 :: The object reference [dbo].[Mentoring].[mentorID] differs only by case from the object definition [dbo].[Mentoring].[MentorID].
    SQL71558 :: The object reference [dbo].[Mentoring].[dueDate] differs only by case from the object definition [dbo].[Mentoring].[DueDate].
    SQL71558 :: The object reference [dbo].[Mentoring].[nextSteps] differs only by case from the object definition [dbo].[Mentoring].[NextSteps].
    SQL71558 :: The object reference [dbo].[Occupation].[datemodified] differs only by case from the object definition [dbo].[Occupation].[DateModified].
    SQL71558 :: The object reference [dbo].[Venture].[datemodified] differs only by case from the object definition [dbo].[Venture].[DateModified].
    SQL71558 :: The object reference [dbo].[Activity].[datemodified] differs only by case from the object definition [dbo].[Activity].[DateModified].
    SQL71558 :: The object reference [dbo].[School].[datemodified] differs only by case from the object definition [dbo].[School].[DateModified].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[NickName] differs only by case from the object definition [dbo].[UserProfileSupplement].[Nickname].
    SQL71558 :: The object reference [dbo].[userprofile] differs only by case from the object definition [dbo].[UserProfile].
    SQL71558 :: The object reference [dbo].[programstatuslog] differs only by case from the object definition [dbo].[ProgramStatusLog].
    SQL71558 :: The object reference [dbo].[userprofile].[upid] differs only by case from the object definition [dbo].[UserProfile].[upid].
    SQL71558 :: The object reference [dbo].[programstatuslog].[upid] differs only by case from the object definition [dbo].[ProgramStatusLog].[upid].
    SQL71558 :: The object reference [dbo].[programstatuslog].[ProgramStatusID] differs only by case from the object definition [dbo].[ProgramStatusLog].[ProgramStatusID].
    SQL71558 :: The object reference [dbo].[ListProgramStatus].[Programid] differs only by case from the object definition [dbo].[ListProgramStatus].[ProgramID].
    SQL71558 :: The object reference [dbo].[userprofile].[upid] differs only by case from the object definition [dbo].[UserProfile].[upid].
    SQL71558 :: The object reference [dbo].[hnp_qPeopleParticipationActivityListing].[@UserId] differs only by case from the object definition [dbo].[hnp_qPeopleParticipationActivityListing].[@userId].
    SQL71558 :: The object reference [dbo].[hnp_qPeopleMentors].[@ProgramID] differs only by case from the object definition [dbo].[hnp_qPeopleMentors].[@programid].
    SQL71558 :: The object reference [dbo].[hnp_qPeopleDevelopmentInformationListing].[@UserId] differs only by case from the object definition [dbo].[hnp_qPeopleDevelopmentInformationListing].[@userId].
    SQL71558 :: The object reference [dbo].[hnp_qPeopleCommunicationNotesListing].[@UserId] differs only by case from the object definition [dbo].[hnp_qPeopleCommunicationNotesListing].[@userId].
    SQL71558 :: The object reference [dbo].[Mentoring].[isComplete] differs only by case from the object definition [dbo].[Mentoring].[IsComplete].
    SQL71558 :: The object reference [dbo].[Mentoring].[isComplete] differs only by case from the object definition [dbo].[Mentoring].[IsComplete].
    SQL71558 :: The object reference [dbo].[hnp_iMITEPProspectiveApp].[@upid] differs only by case from the object definition [dbo].[hnp_iMITEPProspectiveApp].[@UPID].
    SQL71558 :: The object reference [dbo].[UserProfile].[Securityid] differs only by case from the object definition [dbo].[UserProfile].[SecurityID].
    SQL71558 :: The object reference [dbo].[hnp_GetSignupMITE].[@upid] differs only by case from the object definition [dbo].[hnp_GetSignupMITE].[@UPID].
    SQL71558 :: The object reference [dbo].[userprofile] differs only by case from the object definition [dbo].[UserProfile].
    SQL71558 :: The object reference [dbo].[programstatuslog] differs only by case from the object definition [dbo].[ProgramStatusLog].
    SQL71558 :: The object reference [dbo].[userprofile].[upid] differs only by case from the object definition [dbo].[UserProfile].[upid].
    SQL71558 :: The object reference [dbo].[programstatuslog].[upid] differs only by case from the object definition [dbo].[ProgramStatusLog].[upid].
    SQL71558 :: The object reference [dbo].[programstatuslog].[ProgramStatusID] differs only by case from the object definition [dbo].[ProgramStatusLog].[ProgramStatusID].
    SQL71558 :: The object reference [dbo].[ListProgramStatus].[Programid] differs only by case from the object definition [dbo].[ListProgramStatus].[ProgramID].
    SQL71558 :: The object reference [dbo].[userprofile].[upid] differs only by case from the object definition [dbo].[UserProfile].[upid].
    SQL71558 :: The object reference [dbo].[UserProfile].[lastName] differs only by case from the object definition [dbo].[UserProfile].[LastName].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[NickName] differs only by case from the object definition [dbo].[UserProfileSupplement].[Nickname].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[NickName] differs only by case from the object definition [dbo].[UserProfileSupplement].[Nickname].
    SQL71558 :: The object reference [dbo].[UserProfile].[UserName] differs only by case from the object definition [dbo].[UserProfile].[Username].
    SQL71558 :: The object reference [dbo].[hnp_qExportList].[@usertype] differs only by case from the object definition [dbo].[hnp_qExportList].[@UserType].
    SQL71558 :: The object reference [dbo].[UserProfile].[UserName] differs only by case from the object definition [dbo].[UserProfile].[Username].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[privateInd] differs only by case from the object definition [dbo].[UserProfileSupplement].[PrivateInd].
    SQL71558 :: The object reference [dbo].[ListProgramStatus].[programID] differs only by case from the object definition [dbo].[ListProgramStatus].[ProgramID].
    SQL71558 :: The object reference [dbo].[UserProfile].[UserName] differs only by case from the object definition [dbo].[UserProfile].[Username].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[Minorid] differs only by case from the object definition [dbo].[UserProfileSupplement].[MinorID].
    SQL71558 :: The object reference [dbo].[ListMinor].[minorid] differs only by case from the object definition [dbo].[ListMinor].[MinorID].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[NickName] differs only by case from the object definition [dbo].[UserProfileSupplement].[Nickname].
    SQL71558 :: The object reference [dbo].[hnp_qProspAppPreview].[@userId] differs only by case from the object definition [dbo].[hnp_qProspAppPreview].[@UserId].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[Minorid] differs only by case from the object definition [dbo].[UserProfileSupplement].[MinorID].
    SQL71558 :: The object reference [dbo].[ListMinor].[minorid] differs only by case from the object definition [dbo].[ListMinor].[MinorID].
    SQL71558 :: The object reference [dbo].[UserProfile].[UserName] differs only by case from the object definition [dbo].[UserProfile].[Username].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[NickName] differs only by case from the object definition [dbo].[UserProfileSupplement].[Nickname].
    SQL71558 :: The object reference [dbo].[UserProfileSupplement].[NickName] differs only by case from the object definition [dbo].[UserProfileSupplement].[Nickname].

    I am not sure how I can resolve these errors. Is there a way by which I can do that? Any help is appreciated.


    • Moved by CoolDadTx Friday, August 18, 2017 7:24 PM ASP.NET related
    Friday, August 18, 2017 3:02 PM

All replies

  • I am working on migrating an asp.net web forms application to a MVC application using asp.net Identity tables.I already have a database present from my web forms app which I have to use along with the identity tables.

    I suggest that you find a way of converting your security DB table data over to the Identity DB table data. You have too many errors in just adding a FK to Identity table pointing to this table of yours. What about all the stored procedures in the Identity DB that you may have to change that you don't even know about?

    Basically, it looks like you have some table column names that are in conflict.

    You should post to the SQL Server forum about it.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver

    What is the reason that you are converting a ASP.NET Web forum solution, which the Identity security can be applied too along with MVP, Model View Presenter a derivative of MVC, that can be applied to the ASP.NET Web forms that implements Separation of Duties like MVC does? You are asking for some grief coming from ASP.NET Web forms solution over to MVC when MVP does the same thing.

    Myself, I wouldn't make the ASP.NET Web form over to MVC trip knowing that MVP is there, because that conversion is buying me nothing. I would just implement MVP to the ASP.NET forms. 

    If it was a project from scratch, I would consider using MVC.

    http://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP 

     

    Friday, August 18, 2017 4:31 PM
  • Please post questions related to ASP.NET in the ASP.NET forums.
    Friday, August 18, 2017 7:23 PM