April 28, 2003 at 11:12 pm
Hi,
i am doing a marketing based application in C# and Sql server. i have table called funding info with following feilds
fund_id(PK)
pgm_id(FK)
fund_src
fund
this funding info isa part of particular program but there can be n number of funding infos for a particular program(it doesnt have any limit),i designed a simple insert stored procedure for fundinfo and decided to cal it the no.of times ,the user selected the no.of funding infos a user wishes to add, is that a right way to deal with it.
thnx in advance,
sudheer
April 29, 2003 at 6:17 am
Sort of. If I understand you're situation correctly, you are giving the user the ability to add multiple funds to a fund program through your application. I would recommend gathering the information on the form and inserting into sort simple collections (you can use .NET built-in collection classes or implement your own). Then, when the user is finished selecting funds to add, then loop through the collection of fund objects and execute the insert procedure you created with the properties of the collection class as parameters. This way, you avoid long connections to the database and accomplish all your database processing at a single time. An additional advantage is you have an in-memory copy of the data represented on the form (stored in your collection class), which you can use to manipulate the form's data-bound controls without having to hit the database...
HTH,
Jay
April 29, 2003 at 6:30 am
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply