I'm practicing c#. So I created 2 database tables namely tbl_applicant and tbl_parent.
tbl_applicant attributes are:
- AID (primary key)
- Name
- PID (foreign key)
tbl_parent attributes are:
- PID (primary key)
- FatherName
- MotherName
So I got a form in MS Visual Studio 2015 that has the textboxes needed to store the data that the database requires. I also used "identity" (on the pk) and "reference" (on the fk) to associate them with being a primary/foreign key. In c#, I tested the database by recording a row (record) in the tables. Primary keys are automatically generated starting with 1.
Here's the problem, I shouldn't have to place a textbox for PID since it's going to automatically generate me a PID on the tbl_parent but why am I getting errors when I don't put a PID on the tbl_applicant manually? Isn't it supposed to have a number that will be copied/passed to the PID in tbl_applicant? What am I doing wrong here?