Hi people, i have long time searching for this subject, how can i delete the Parameters that i have on a Command Object. Because i have to make a lot of querys, but using only i command object. Hope you can help me.
The Delete method deletes a Parameter object from the Parameters Collection. <BR> <BR>The Syntax is: Parameters.Delete Index <BR><BR>The Index parameter is either the name property or the ordinal position (index) in the collection of the Parameter object. <BR><BR>Here is an example for deleting: <BR>objCommand.Parameters.Delete 3 <BR>
Ok i see i can use the Index number(Begin with 0) or the Parameter name. And Is working. Thanks. Now But<BR> I have one script where i need to make about 5 SP one after onother one i do this:<BR>MyCommand.CommandType = adStoreProc<BR>MyCommand.ActiveConnection = MyConn<BR><BR>MyCommand.CommandText = "SP1"<BR>create my parameters<BR>Execute 8 'NoRecordsReturn <BR>Delete Parameters<BR>'New Query<BR>MyCommand.CommandText = "SP2"<BR>Create Parameters<BR>Execute 8<BR>Delete Parameters.<BR>Etc.<BR>Delete MyCommand<BR><BR> These steps are good? These way i was searching for "How to Delete Parameters From Command" To make these script. Because some time my IIS say that i need a INSERT UPDATE DELETE went i Execute my SP. And i was wondering if i miss something? Hope you can teach me. Thanks.<BR> "Happy New Year"<BR>
.. do it is:<BR><BR>Create Command Object<BR>Use It<BR>Destroy Command Object<BR><BR>Create Command Object<BR>Use It<BR>Destroy Command Object<BR><BR>And, where are you that it's the new year already?
I was thinking that Destroying the complete Object with Command = Nothing(Command and Parameters) take more CPU cycles than only destroying the Object Parameters with Command.Parameters.Delete Index(the paramaters i create). But but I have reasoned and You Are Right About What's this Performance. Thanks for your answer.