|
Hey I have work with c# and Sql server for awhile but never had to build anything from start-up. I created a database with basic stored procedure. insert, update, and delete basic stuff. I have a problem with duplicate records. When they click the save button the data is save but, tb1 has a new entry with duplicate project name and tb2 has a duplicate with system name each receives a new pk number. I tried validation check if exist get error can't modified existing pk. I have pk and fk on each table connected to tb1 and tb2. any help any one can give is appreciated. If I can get example code a link to reference(any thing) :confused ok.. here we go.
(comments are locked)
|
|
Your problem is caused by the fact that your procedure needlessly tries to insert new project record in tb1 and new system record in tb2. This action is not needed at all as these tables are your catalogs, your users don't need to insert new records in these. Your webforms have 2 dropdowns which are populated with
When you save data, you only need to insert tb3, that is all. You get pid from the value of the selected item of the first dropdown, and sid from the value of the selected item of the second dropdown. Hope this helps, Oleg
(comments are locked)
|


Probably you have problem in the insert(update) stored procedures. Post the code of them here. Also Let us know which one are called when you press the save button.