Last post Jan 17, 2017 02:07 AM by tangara
Jan 15, 2017 07:56 AM|tangara|LINK
I am at this point where I need to insert data into the database.
However, I am abit unsure what is the best way going forward.
Basically, my form I have different sections.
At the top part is two hidden labels - the form number and the status.
The first section, I have some data that is using Session to populate onto the labels while some parts the data need to enter by themselves.
On the second section, I have a dropdownlist which draw out some data and populate onto the labels while it allows the labels to be written over.
And the third is using dropdownlist to populate the related in a gridview using an add button.
So, I hope someone can advise me can I update everything of this form to a table once and for all when the user click save or submit ?
PS. I have to use Stored Procedure
Jan 16, 2017 05:36 AM|Eric Du|LINK
According to your description, I know your meaning is want to update or insert the whole form data to database. But as far as I know, if you want to update this record, you need check this record exist or not(like ID). If exist, execute update command, else
execute insert command. Please refer to these links that insert data to database using stored procedure.
Insert Data Into Database by Stored Procedure in ASP.Net C#:
Calling Insert SQL Server Stored Procedures using ADO.Net:
Jan 17, 2017 02:07 AM|tangara|LINK
Tks for your reply but I have some considerations.
For example, if I were to update onto one single table, how do I update the tables which gives me some of the data but some which require users to input themselves ?
Furthermore, I have this authorization section which I am adding in now which will forward to the respective personnels for approval.
And I dun think I have to repeatedly design this section cos I just make it visible to each RoleId right ?
So, in this case, how do I update into a single table cos it's going to be the same 2 textbox labels.
What is your advice in this case ?