Results 1 to 2 of 2

Thread: Running A Stored Procedure from .NET

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2001
    Location
    Buffalo, NY
    Posts
    297

    Running A Stored Procedure from .NET

    Hey All,

    Here is my code:

    Code:
                odcQuote.Open()
    
                odcmQuote = New Odbc.OdbcCommand
                odpQuote = New Odbc.OdbcParameter
    
                odcmQuote.Connection = odcQuote
                odcmQuote.CommandText = strSPName
                odcmQuote.CommandType = CommandType.StoredProcedure
    
                odpQuote.ParameterName = strSPParamName
                odpQuote.OdbcType = Odbc.OdbcType.Int
                odpQuote.Value = intParamVal
                odpQuote.Direction = ParameterDirection.Input
    
                odcmQuote.Parameters.Add(odpQuote)
    
    
                odcmQuote.ExecuteNonQuery()
                odcQuote.Close()
    I'm getting an Error on the ExecuteNonQuery command:

    "The Stored Procedure *whatever* requires a parameter named @intQotID"

    Which is true, but that parameter I add is definatley named "@intQotID". Any idea why it isn't recognizing it?

    Thanks!

    --Ben

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    You have it as an input parameter. Try it as an output parameter.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width