What is the best way to write data from a .NET web form to SQL Server 2005?
My web application creates forms dynamically and the amount of fields on each form could range from a few to close to one hundred.
The way I'm currently doing this is to collect the submitted form data (using the Request.Form.AllKeys
method) into a data table, open a sql connection and call the same stored procedure for each row in my data table before closing the connection again. This seems an inefficient way of doing things.
I know I can use SqlBulkCopy
for this purpose but I then lose the functionality given to me by stored procedures (the ability to chain different commands together, for instance).
Does anybody have any suggestions?