Author: mattatuni2 | Posted on: 1/15/2009 3:25:38 PM | Views : 303

Hi im new to vb.net, I am currently working on a stock system, the below code is from a method in a web service i have created that allows someone to request items, the paramenters supplied to the webservice are itemID, qty and branch id.

I want to check the database to make sure that the item requested is in stock , if it is then the stock table will be decreased by the amount requested, I get an error though due to the output of the select statement not being in integer format.. the second part of the code works ....can anyone help with the first section (checking how many of the item requested are in stock and then putting that into the variable --'amountcheck')

Public Function RequestOrder(ByVal ItemID As Integer, ByVal qty As Integer, ByVal branchID As Integer) As Boolean

Dim strUpdate As String
Dim conn As SqlConnection

Dim cmd As SqlCommand
Dim connStr As String
Dim amountcheck As Int ...

Go to the complete details ...