Please help, so i created a login form a registration and a dashboard, first, their are two database tables, the Users_Table and the Dashboard_Table
The users_table contains the:
The dashboard_table contains the:
what i plan to do is that whenever a user logs in he is then brought to the dash board windows form,(there are 3 forms, login, registration and dashboard) then when he is at the dashboard form there is a data grid view where the data from the dashboard_table is listed but the problem is how do i connect the primary key user_id in the users_table and foreign key user_id in the dashboard_table so that whenever a user logs in, he has that unique user_id that is tied to the username he entered, and that the data that will be displayed in the data grid view in the dashboard form are those that are only associated with his user_id, like for example, :
James logged in, his user_id is 1, only data that are associated with the user_id 1 are displayed in the data grid view, like
(user_id, item_name, item quantity)
1 Pop Tarts 5
1 Tomato Sauce 2
1 Mozzarella cheese 3
but what happens is, there is no data inside the data gridview, i want it to be at least empty and there is an add button and delete button and edit button with their own text boxes
Another problem, i opened ssms and looked at the database tables,
when James registered through the registration form, his username only created a record in the users_table and the dashboard_table was still empty. Take note, the user_id is in auto increment.
How will i make it that whenever a new user registers, and his/her data is stored in the users_table, a empty record is also created in the dashboard_table, how can i do this using foreign and primary keys in ssms then manipulate it in visual studio windows forms?
What I have tried:
I currently have the login and registration and the dashboard forms done and the two database tables, but i dont know how to link and use foreign and primary keys, since im really new to Sql,