SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question regarding BYO ASP.NET 2.0 Web Site...

    Good book so far. I'm getting the hang of it until now. On page 286 it says
    "After creating the foreign key, make a quick test to ensure that the relationship is indeed enforced. Try adding an employee, but set the person's DepartmentID to 123."
    I followed along in the book exactly as stated prior to this, but did not get the error. It allowed me to enter the "123" with no problem. I went to the next record to make sure that the data was taken, but it's just not happening. What did I forget?

  2. #2
    SitePoint Co-founder Matt Mickiewicz's Avatar
    Join Date
    Jul 1999
    Location
    Vancouver, Canada
    Posts
    2,384
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try downloading the code archive to ensure there isn't a typo somewhere:

    http://sitepoint.com/books/aspnet2/codearchive.php

    and also check out:

    http://sitepoint.com/books/aspnet2/errata.php
    Matt Mickiewicz - Co-Founder
    SitePoint.com - Empowering Web Developers Since 1997
    Follow me on Twitter.

  3. #3
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Once I closed the SQL Server manager and reopened it, the foreign key constraint worked. Is this what you have to do every time you want to test your database tables and relationships? There must be another way...


Bookmarks

Posting Permissions

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