SqlParameterCollection Reuse- App architecture decision

Tech-Archive recommends: Speed Up your PC by fixing your registry



My DAL uses StoredProc CommandTypes for my TypedDataSet
DataAdapter.Update(myTable) I use a number of the same Parameters for
different Tables when calling the update. Currently I use

after explicitly assigning (maybe a dozen) Parameters:

Command.Parameters.Add(aCommonParameter);
propertyNumberParameter.SourceColumn
= myTypedDataSet.myTable.TypedColumn.ColumnName;

for each parameter. After Updating, I use

myTableCommand.Parameters.Clear()

to free the Parameters for use by other DataSet commands

If I initialize a tableCommand.Parameter for each Table, I need to create a
LOT of duplicate parameters, but would not have to assign and clear each time
I perform DataAdapter.Update(Table). Where is the runtime performance/code
maintenance sweet spot here? Should I have unigue parameters for every
command, or reuse my common params?

Bill
--


.