Stored Procedure call

S

Steven K

Hello,

With ASP, I could indicate that a variable was a stored procedure with
parameters by using "adcmdStoredProc", and set the data variable with one
line using the Execute command (cnnSearch is the connection):

Set spSearch = cnnSearch.Execute("sp_web_Search " &
"'FindRegionSubRegion','','',''", adcmdStoredProc)

ASP .Net
Following the help text in quickstart, I am now using two lines:
spSearch = New SqlDataAdapter("sp_web_Search " &
"'FindRegionSubRegion','','',''", cnnSearch)
spSearch.SelectCommand.CommandType = CommandType.StoredProcedure

The question I have is, with ASP .Net, is it possible to set the CommandType
in the first line somewhat like I could do with ASP?
 
C

Chris Jackson

Unfortunately, there is no constructor for the SqlDataAdapter class that
takes a CommandType argument, and the default is Text. For the time being,
you are stuck with two lines of code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top