I am designing a registration form where I use CreateUserWizard. I am inserting data into two different tables while use is created. First table is Categories (columns: CustomerID, CatCode) where I insert CatCodes based on selections made in CheckBoxList
and second table is Customers (columns: CustomerID, FName, LName, Email) where I register personal details (first, last name, email etc). CustomerID is generated automatically when client registers.
What I want to do is to connect Categories and Customers tables so when client selects CatCodes during registration and selected values are written into the Categories table CatCode column, appropriate CustomerID to be written there as well (in CustomerID
column which is a ForeignKey from Cusomers table).
For example: Client is registered, his CustomerID (1001) is created during registration. He also selected three categories (1,2,3) which are written into the Categories table. Now as I have CustomerID in Categories Table as well
(ForeignKey from Customer Table CustomerD column), I want generated CustomerID to show up in Categories table so i could later identify what catgories did client 1001 selected.
I am using follwing sql statement to do this but it does not work: