title: Stored procedure Parameter Type validation
body: <p>net code that executes a stored procedure </p>
  
  <pre><code>        Dim cmd As New SqlCommand("get_list_of_users", connection)
          Dim table As New DataTable
          Dim adapter As New SqlDataAdapter
          Dim param As New SqlParameter("@TypeID", SqlDbType.Int)
  
          param.Direction = ParameterDirection.Input
          param.Value = typeID
          cmd.Parameters.Add(param)
  
          cmd.CommandType = CommandType.StoredProcedure
          adapter.SelectCommand = cmd
          adapter.Fill(table)
  </code></pre>
  
  <p>Unfortunately the <em>@TypeID</em> parameter in the stored procedure was not configured to be an <em>integer</em> but a <em>bit</em>, you can imagine the consequences and the amount of time we had to waste debugging it.</p>
  
  <p>Is there a way to configure a "stricter" mode to pass parameters to a stored procedure so that an exception would be raised if the data type defined does not match the stored proc definition?</p>
  
  <p>Thanks all</p>