title: SQL Data Type function parameter when writing function to create a stored procedure parameter
body: <p>I'm currently writing a function that will make it easier to add parameters to stored procedures programmatically, but so far the only stumbling block I'm having is adding the data type in as a function parameter. The code is:</p>
  
  <pre><code>Public Shared Function spParamAdd(cmd As SqlCommand, paramName As String, dataType As SqlDbType, value As String)
      Dim command = cmd.Parameters.Add(paramName, SqlDbType.dataType).Value = value
      Return command
  End Function
  </code></pre>
  
  <p>And the code I'm trying to derive this from is: </p>
  
  <pre><code>cmd.Parameters.Add("@USERID", SqlDbType.Int).Value = 1
  </code></pre>
  
  <p>Finally, the error I'm getting is:</p>
  
  <blockquote>
    <p>dataType is not a member of System.Data.SqlDbType</p>
  </blockquote>
  
  <p>Any suggestions welcome.</p>