davy_g
Well-known member
Hi all,
I want to create a relational database (MS SQL Server) with 2 tables:
- Caller
- Incident
There is a link between Caller and Incident. caller.caller_id is the primary key and incident.caller_id is the foreign key.
1 caller can have multiple incidents on it's name (1 to n).
I will have a form in which I want to create a new incident. The field Caller should be a dropdown-menu which lists all callers in the table caller.
When I want to insert a new incident, how should I handle this?
How do I implement this caller_id also? I don't know what the caller_id of John Doe is.
How should I change my insert-statement?
Thanks
I want to create a relational database (MS SQL Server) with 2 tables:
- Caller
- Incident
There is a link between Caller and Incident. caller.caller_id is the primary key and incident.caller_id is the foreign key.
1 caller can have multiple incidents on it's name (1 to n).
I will have a form in which I want to create a new incident. The field Caller should be a dropdown-menu which lists all callers in the table caller.
When I want to insert a new incident, how should I handle this?
VB.NET:
con.Open()
command = New SqlCommand("INSERT incident_first (id, request, action, solved) " & "VALUES (@id, @request, @action, @solved) ")
command.Parameters.Add("@id",txtId.Text)
command.Parameters.Add("@request", txtRequest.Text)
command.Parameters.Add("@action", txtAction.Text)
command.Parameters.Add("@solved", txtSolved.Text)
command.ExecuteNonQuery()
MsgBox("Data inserted")
con.Close()
How do I implement this caller_id also? I don't know what the caller_id of John Doe is.
How should I change my insert-statement?
Thanks