Re: Stored Procedure Return value question

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Daniel Buchholz (news-daniel-0501_at_paranor.de)
Date: 02/10/05


Date: Thu, 10 Feb 2005 15:07:53 +0100

Nick wrote:

> Thanks for this. Am I missing something though? The code generates an error
> at the ExecuteNonQuery line - saying it can't find the sp... Here's the code
> now:
>
> Dim objCmd As New SqlCommand("spd_InsertCompanyDetails " & SQLinsert,
> objConn)

Uh, sorry, my fault.

You have to specify your parameters to the procedure. The "SQLInsert"
part is not correct.

For each parameter you have to pass do something like

sqlCmd.Parameters.Add("[yourSPParam]", [yourParamValue])

after creating the Command like

Dim objCmd As New SqlCommand("spd_InsertCompanyDetails")

Daniel



Relevant Pages