Server Error in '/' Application RRS feed

  • Question

  • User476993467 posted

    I have seen countless amounts of information on this and can not seem to find anyone trying to do this within an Intranet environment, using only Active Directory (Windows) Authentication.  There is no need to create separate user accounts within the aspnetdb, infact I am not even sure I need the aspnetdb if I am not going to use the Forms Authentication.  I have gotten everything to work with Windows Authentication up until I push the "Finish" button on posting a new ad.  I get this error:

    The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Ads_Members". The conflict occurred in database "Classifieds", table "dbo.Members", column 'Id'.
    The statement has been terminated.

    I guess what I am looking for is probably fairly simple.  Will the .cs pages need to be rewritten to reflect the fact that there is no need to use Forms Authentication? 
    After looking at the relationships between the tables it seems that I might be better off starting from scratch rather than using this app.    I am just trying to get a simple Items For Sale area set up for in-house use only within our Domain.

    Any help anyone can provide would be greatly appreciated.



    Friday, July 25, 2008 1:41 PM

All replies

  • User-125547262 posted

     Looks like a data issue and not an authentication issue.  My guess is that you have a members table whose ID is a foreign key in the Ads. You are now trying to insert an ad for a member whose id does not exist in the members table.

    Friday, July 25, 2008 1:46 PM
  • User2030760008 posted

    Could you give us an example of how you are inserting the value.  The error you are getting is because you have a Foreign Key Restrains between classified and members or some similair table.  You must first update the members table with a member with the proper ID, and then from there use that members ID to insert the ad. 

    Friday, July 25, 2008 1:54 PM
  • User476993467 posted

    I think that is where my problem is.  I want to be able to have the members table auto populated with the "Domain\Username" of the individiual when they first go to the page.  After that, it is just a check to make sure it doesn't put in a duplicate.  But the way all the code is written in the back end .cs pages, they are a lot of references to the aspnetdb stored procedures.  I know this app was specifically written with Forms Authentication in mind, but it would be nice to get it to work on our Internal network with out having folks register for it.  They are already authenticated on the network, so no need to have them authenticate to this Web App again.  I hope I am making sense.  Been a long day!!!

    Friday, July 25, 2008 2:16 PM
  • User2030760008 posted

    Here is a great little blog posting about windows authentication that I think would be of great interest to you... http://weblogs.asp.net/scottgu/archive/2006/07/12/Recipe_3A00_-Enabling-Windows-Authentication-within-an-Intranet-ASP.NET-Web-application.aspx .


    Hope it helps,


    Friday, July 25, 2008 2:30 PM