Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.40 KB | None | 0 0
  1. myConnection.Open()
  2.         Dim myCommand As New SqlCommand("_lei_get_inventory", myConnection)
  3.         myCommand.CommandType = CommandType.StoredProcedure
  4.         myCommand.Parameters.Add("@upccode", SqlDbType.NVarChar).Value = sku.ToString()
  5.  
  6.         'Create a SqlParameter object to hold the output parameter value
  7.         Dim frame_name As New SqlParameter("@fram_name", SqlDbType.NVarChar)
  8.         Dim frame_color As New SqlParameter("@frame_color", SqlDbType.NVarChar)
  9.         Dim retail_price As New SqlParameter("@retail_price", SqlDbType.NVarChar)
  10.         Dim inv_count As New SqlParameter("@inv_count", SqlDbType.Int)
  11.  
  12.         'IMPORTANT - must set Direction as Output
  13.         frame_name.Direction = ParameterDirection.Output
  14.         frame_color.Direction = ParameterDirection.Output
  15.         retail_price.Direction = ParameterDirection.Output
  16.         inv_count.Direction = ParameterDirection.Output
  17.  
  18.         'Finally, add the parameter to the Command's Parameters collection
  19.         myCommand.Parameters.Add(frame_name)
  20.         myCommand.Parameters.Add(frame_color)
  21.         myCommand.Parameters.Add(retail_price)
  22.         myCommand.Parameters.Add(inv_count)
  23.  
  24.         Dim myDataAdapter As New SqlDataAdapter()
  25.         myDataAdapter.SelectCommand = myCommand
  26.  
  27.  
  28.         '4. Populate the DataSet and close the connection
  29.         Dim myDataSet As New DataSet()
  30.         myDataAdapter.Fill(myDataSet)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement