3
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by thines01
0

It looks like some code has been removed.
You're saying this code actually updates the database?
In either case, the SqlCommand object is missing.

0

It looks like some code has been removed.
You're saying this code actually updates the database?
In either case, the SqlCommand object is missing.

yes it works, i have my sqlCommand in my modules. The issue however is not the connection, it is to do with the FK and PK which does not seem to link accordingly. I hope I am phrasing my questions correctly?

0

This SQL looks like it is trying to do two inserts simultaneously.
Is that what you're trying to do?

If so, they need to be separated into two different commands.

0

Why do you have the details in a second table. It doesn't look like you need it, just move all the fields in the details table into the Customers table. If you wish to persist with the design you have then the insert into customers table at line 7 does not include the the Details_Id. YOu need to work out the ID of the record you have inserted into the Details table and include that in the INSERT into the Customers table.

0

Why do you have the details in a second table. It doesn't look like you need it, just move all the fields in the details table into the Customers table. If you wish to persist with the design you have then the insert into customers table at line 7 does not include the the Details_Id. YOu need to work out the ID of the record you have inserted into the Details table and include that in the INSERT into the Customers table.

Well I have normalised the database. I have another table called suppliers that uses Details table to collect the information for suppliers. I thought instead of asking both questions on here if i got the customers to work I would be able to implement it on suppliers too.

I have a brief understanding, I need to get the last details ID to automatically link to my customers Details ID if that makes sense?. I just dont know what command to use :( . Kindly advice if you have an idea.

Thanks in advance

0

This SQL looks like it is trying to do two inserts simultaneously.
Is that what you're trying to do?

If so, they need to be separated into two different commands.

Well I was thinking since the tables are different and both the tables need to be filled in the inserts should be simultaneous, however after trying it out it didnt work. Thats why I have posted the code up. Do you reckon i should seperate the commands, and then after find a link for the Details ID's?. Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.