How to fix this error in a quiz maker web application?
<p>I developed a quiz engine similar to this one in the ASP.NET website, but I just added a new table to the design of the database. The original design of the database consists of three tables as following:</p>

<p><strong>Quiz Table:</strong> QuizID, Title, Description</p>

<p><strong>Question Table:</strong> QuestionID, Question, Answer1, Answer2, Answer3, Answer4, CorrectAnswer, AnswerExplanation, QuestionOrder, QuizID</p>

<p><strong>UserQuiz Table:</strong> UserQuizID, QuizID, DateTimeComplete, Score, Username</p>

<p><em><strong>The first attribute in each table is the primary key of that table</em></strong></p>

<p>What I did is just adding a new table which is:</p>

<p><strong>User Table:</strong> Username, Name, Job, Address (Username is the primary key of this table)</p>

<p>For the code-behind, I did not touch anything but when I tried to execute the code, it gave me an error.
The code-behind is:</p>

<pre><code>using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Results : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ArrayList al = (ArrayList)Session["AnswerList"];

        if (al == null)
        {
            Response.Redirect("default.aspx");
        }

        resultGrid.DataSource = al;
        resultGrid.DataBind();

        // Save the results into the database.
        if (IsPostBack == false)
        {
            // Calculate score
            double questions = al.Count;
            double correct = 0.0;


            for (int i = 0; i &lt; al.Count; i++)
            {
                Answer a = (Answer)al[i];
                if (a.Result == Answer.ResultValue.Correct)
                    correct++;
            }

            double score = (correct / questions) * 100;

            SqlDataSource userQuizDataSource = new SqlDataSource();
            userQuizDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["testConnectionString"].ToString();
            userQuizDataSource.InsertCommand = "INSERT INTO [UserQuiz] ([QuizID], [DateTimeComplete], [Score], [UserName]) VALUES (@QuizID, @DateTimeComplete, @Score, @UserName)";

            userQuizDataSource.InsertParameters.Add("QuizID", Session["QuizID"].ToString());
            userQuizDataSource.InsertParameters.Add("DateTimeComplete", DateTime.Now.ToString());
            userQuizDataSource.InsertParameters.Add("Score", score.ToString());
            userQuizDataSource.InsertParameters.Add("UserName", User.Identity.Name);

            int rowsAffected = userQuizDataSource.Insert();
            if (rowsAffected == 0)
            {
                // Let's just notify that the insertion didn't
                // work, but let' s continue on ...
                errorLabel.Text = "There was a problem saving your quiz results into our database.  Therefore, the results from this quiz will not be displayed on the list on the main menu.";


            }

        }


    }

    protected void resultGrid_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlDataSource1.FilterExpression = "QuestionOrder=" + resultGrid.SelectedValue;
    }
}
</code></pre>

<h2>The error:</h2>

<p><strong>The INSERT statement conflicted with the FOREIGN KEY constraint "FK_UserQuiz_employee". The conflict occurred in database "psspdb", table "dbo.employee", column 'Username'.
The statement has been terminated.</strong> </p>

<p>Source Error: </p>

<pre>
Line 50:             userQuizDataSource.InsertParameters.Add("UserName", User.Identity.Name);
Line 51: 
Line 52:             int rowsAffected = userQuizDataSource.Insert();
Line 53:             if (rowsAffected == 0)
Line 54:            
</pre>

<p><strong>The Username in the UserQuiz table is a foreign key to the Username in the User Table. I know about that but what I should do to fix this problem.</strong></p>
