Click here to Skip to main content
15,887,240 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I am stuck in a situation wherein i am given to design a form(financial year) which contains many unique fields.I want to know how do i insert these many fields to database as using prepared statement would mean my Insert statement would go endless(as the fields are 60).The form pattern is i have months vertically arranged and 5 headers (horizontally arranged).Also an option of using an array wont work since all the fields are unique..

Any help would be highly appreciated.
Thanks in advance
Posted

1 solution

You can create a Data Transfer Object, which will be a class with all your fields as properties. You can create a List of your Data Transfer Object fill it with your form data and send it.

You better use to a stored procedure to Insert your Data, if the Data Volume is big. In the case of Stored Procedure you can pass all your Data as XML to the Stored Procedure instead of using a Prepared Statement, which will be much faster than a Prepared Statement.

Hope this advice helps.
 
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