I'm trying to insert data into fingerprint table which has four columns - ID (primary key) - StudentID (foreign key) linked to student table - description - Template
But the following error keeps coming up. I can't turn off the IDENTITY for ID as I want it to increment automatically. I also have a student table to store information. What I want to achieve is that after entering student details, I want to copy the studentID that was generated before onto the fingerprint table - StudentID column. the code I have for this is shown below.
private void btnSave_Click(object sender, EventArgs e)
        {
            fgrTemplate template = new fgrTemplate();
            template.StudentID = std.StudentID;
            template.Description = fngDes.Text;
            template.Template = m_StoredTemplate;
            if (upload.InsertTemplate(template))
            {
                MessageBox.Show("Student Successfully Added!");
            }
            else
            {
                MessageBox.Show("Student Not Successfully Added!");
            }
using (SqlCommand com = new SqlCommand("INSERT INTO tblFingerprint (StudentID, Description, Template) values ('" + template.StudentID + "' ,'" + template.Description + "' ,@Template)", cn))
this is what I have on my web service. However it gives me the error
 
    