Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / March 2005



Tip: Looking for answers? Try searching our database.

Stored Procedure Parameters Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RS - 29 Mar 2005 19:43 GMT
Hi,
If I want to call the same stored procedure several times - each time
replacing the parameters, do I need to delete the parameters
collection between each call?

Example - After I do this:
 cmd.Parameters.Append cmd.CreateParameter("ID", adInteger,
adParamInput, , ID1)

cmd.Parameters.Append cmd.CreateParameter("name", adInteger,
adParamInput, , Name1)

 cmd.Parameters.Append cmd.CreateParameter("Address", adInteger,
dParamInput, , Address1)
       
           cmd.Execute  

Do I need to do this before I can call the SP again with a new set of
parameters?:
cmd.Parameters.Delete "ID"
cmd.Parameters.Delete "Name"
cmd.Parameters.Delete "Address"

Or, will the creating a new set of parameters for the subsequent
replace the existing ones?

Thank you.
Lishi Liu [MSFT] - 30 Mar 2005 01:47 GMT
You can keep the parameter, don't need to delete and re-create them.
Simply change the value of each parameter(if need to), then execute the
command again.

for example:
cmd.Parameters("ID").Value = 1000
cmd.Parameters("name").Value = "Some One"
cmd.Parameters("Address").Value = "some place"
cmd.Execute  

lishil, VSData team
--------------------
>From: RS <russ@epcinternet.com>
>Newsgroups: microsoft.public.vb.database.ado
[quoted text clipped - 9 lines]
>X-Complaints-To: abuse@prodigy.net
>X-Trace: newssvr31.news.prodigy.com 1112121792 ST000 66.72.155.37 (Tue, 29
Mar 2005 13:43:12 EST)
>NNTP-Posting-Date: Tue, 29 Mar 2005 13:43:12 EST
>Organization: SBC http://yahoo.sbc.com
>X-UserInfo1:
[[PGW\WE@ZVQB\TX\ZOD]_\@VR]^@B@MCPWZKB]MPXHTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_D
OLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^
@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN
>Date: Tue, 29 Mar 2005 18:43:12 GMT
>Path:
TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!newshosting.com!nx01.iad01.newshosting.com!207.115.63.142.MISMATCH!n
ewscon02.news.prodigy.com!prodigy.net!newsmst01a.news.prodigy.com!prodigy.co
m!postmaster.news.prodigy.com!newssvr31.news.prodigy.com.POSTED!bb41a1d1!not
-for-mail
>Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.vb.database.ado:100350
>X-Tomcat-NG: microsoft.public.vb.database.ado
[quoted text clipped - 26 lines]
>
>Thank you.
RS - 30 Mar 2005 17:00 GMT
Thank you.

>You can keep the parameter, don't need to delete and re-create them.
>Simply change the value of each parameter(if need to), then execute the
[quoted text clipped - 7 lines]
>
>lishil, VSData team
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.