Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- myConnection.Open()
- Dim myCommand As New SqlCommand("_lei_get_inventory", myConnection)
- myCommand.CommandType = CommandType.StoredProcedure
- myCommand.Parameters.Add("@upccode", SqlDbType.NVarChar).Value = sku.ToString()
- 'Create a SqlParameter object to hold the output parameter value
- Dim frame_name As New SqlParameter("@fram_name", SqlDbType.NVarChar)
- Dim frame_color As New SqlParameter("@frame_color", SqlDbType.NVarChar)
- Dim retail_price As New SqlParameter("@retail_price", SqlDbType.NVarChar)
- Dim inv_count As New SqlParameter("@inv_count", SqlDbType.Int)
- 'IMPORTANT - must set Direction as Output
- frame_name.Direction = ParameterDirection.Output
- frame_color.Direction = ParameterDirection.Output
- retail_price.Direction = ParameterDirection.Output
- inv_count.Direction = ParameterDirection.Output
- 'Finally, add the parameter to the Command's Parameters collection
- myCommand.Parameters.Add(frame_name)
- myCommand.Parameters.Add(frame_color)
- myCommand.Parameters.Add(retail_price)
- myCommand.Parameters.Add(inv_count)
- Dim myDataAdapter As New SqlDataAdapter()
- myDataAdapter.SelectCommand = myCommand
- '4. Populate the DataSet and close the connection
- Dim myDataSet As New DataSet()
- myDataAdapter.Fill(myDataSet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement