Click here to Skip to main content
15,919,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends

I am saving Employee personal details in one table and education details which has multiple rows that's why I am saving into another table.

Multiple text boxes are there in Education details Instead of creating parameters to every textbox column.Is there any chance to form all records in a temporary table and single save click that temporary table data is inserted into sql datatable.

Please suggest me how to achieve this functionality.

What I have tried:

I have not tried.I am asking for suggestion to achieve this task.
I have field names like this
DegreeName NameoftheInstitute Specialization..
TextBox1 Textboxes Textboxes
-----
TextBox5
Posted
Updated 6-Sep-16 23:45pm
Comments
PradyumanSingh 7-Sep-16 5:41am    
Your question does not provide complete information.
What all i could understand is, you want to save data into multiple tables on a single button click.
There are two ways to do it -
1) You can write as many insert query on a button click as you want.
2) You can create a stored procedure to enter data into multiple tables and call the procedure on your c# page.
3) If entry in one table depends on the other, than you can create a trigger on one table to perform insert / update into another table.

1 solution

Instead of creating separate text boxes, consider setting up a table based control such as a DataGridView instead, and getting the user to fill that in: https://msdn.microsoft.com/en-us/library/ms171610%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396[^]
Then, you can use that to insert to the DB directly: Insert (Save) Multiple rows from DataGridView to Database in Windows Forms (WinForms) Application using C# and VB.Net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900