Stored Procedure call

  • Thread starter Thread starter Steven K
  • Start date Start date
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?
 
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.
 
Back
Top