i have 3 tables in my site.
- Users
- Threads
- Comments
I connected the comments primary key to Threads comments field. I want to use insert into command while feeding comments to specific threads.
How do i write the command?!?
is it like this:
string myCommand="INSERT INTO [Threads].[Comments] VALUES(....";
Will the messages be inserted into a specific thread?
What if i want to insert data to both simultaneously.. e.g. a headline to a thread and a date to the comment…can i combine two commands into one?
You have set up your foreign key back to front, if you have a foreign key in the threads table that links to the primary key of the comments table then one comment can relate to many threads but a thread can only have one comment.