title: Foreign Key confusion
body: <p>I am new to database and making a gym management system, I implemented a database from the tutorials on www.homeandlearn.co.uk. I have completed the project without foreign keys. Now I have to link tables but I am getting this error:</p>
  
  <blockquote>
    <p>Update cannot proceed due to validation errors.<br>
    Please correct the following errors and try again.</p>
    
    <p>SQL71516 :: The referenced table '[dbo].[member_info]' contains no primary or candidate keys that match the referencing column list in the foreign key. If the referenced column is a computed column, it should be persisted.</p>
  </blockquote>
  
  <p>I do not know what is this error  about. Please tell me how to fix this? Do i have to create a new database now or I can still use the foreign keys in the same database? I am using Visual Studio 2012. All help will be appreciated. Thanks in advance.
  Cheers,</p>
  
  <p>I do have a primary key, and I have set it to increment by 1. see this is my table.</p>
  
  <pre><code>CREATE TABLE [dbo].[member_info] (
  [Id]                INT           IDENTITY (1, 1) NOT NULL,
  [memberName]        NVARCHAR (50) NULL,
  [father_name]       NVARCHAR (50) NULL,
  [age]               NCHAR (10)    NULL,
  [address]           NVARCHAR (50) NULL,
  [contact]           NVARCHAR (50) NULL,
  [height]            NVARCHAR (50) NULL,
  [weight]            NVARCHAR (50) NULL,
  [chest]             NVARCHAR (50) NULL,
  [triceps_biceps]    NVARCHAR (50) NULL,
  [waist]             NVARCHAR (50) NULL,
  [shoulders]         NVARCHAR (50) NULL,
  [thighs]            NVARCHAR (50) NULL,
  [calves]            NVARCHAR (50) NULL,
  [instructor]        NVARCHAR (50) NULL,
  [date_of_admission] DATE          NULL,
  [photo]             IMAGE         NULL,
  PRIMARY KEY CLUSTERED ([Id] ASC)
  CONSTRAINT [FK_member_info_instructor_info] FOREIGN KEY ([instructor]) REFERENCES
  [instructor_info]([instructor])
  );
  </code></pre>
  
  <p>This is my member_info and below is my instructor_info table:</p>
  
  <pre><code>CREATE TABLE [dbo].[instructor_info] (
  [InstructorID]      INT            IDENTITY (1, 1) NOT NULL,
  [instructor]        NVARCHAR (50)  NULL,
  [father_name]       NVARCHAR (50)  NULL,
  [age]               NCHAR (10)     NULL,
  [address]           NVARCHAR (MAX) NULL,
  [contact]           NVARCHAR (50)  NULL,
  [height]            NCHAR (10)     NULL,
  [weight]            NCHAR (10)     NULL,
  [chest]             NCHAR (10)     NULL,
  [triceps_biceps]    NCHAR (10)     NULL,
  [waist]             NCHAR (10)     NULL,
  [shoulders]         NCHAR (10)     NULL,
  [thighs]            NCHAR (10)     NULL,
  [calves]            NCHAR (10)     NULL,
  [memberName]           NVARCHAR (50)  NULL,
  [date_of_admission] DATE           NULL,
  [photo]             IMAGE          NULL,
  PRIMARY KEY CLUSTERED ([InstructorID] ASC)
  );
  </code></pre>