Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
VB
Dim tmpDS As DataSet

        objcon.GetData("SELECT AvailQty FROM  StockMF WHERE ItemNm = cmbItm.Value.Selected")
        If objcon.DS.Tables(0).Rows.Count > 0 Then
            tmpDS = objcon.DS
            If txtQty.Text > tmpDS.Tables(0).Rows(0).Item("AvailQty") Then
                MsgBox("Insufficient Stock", MsgBoxStyle.Information)
            End If

        End If
End Sub
Posted
Updated 1-May-14 20:46pm
v2
Comments
Maciej Los 2-May-14 2:47am    
What have you tried? Where are you stuck?
thatraja 2-May-14 3:04am    
Not clear
Sanjay K. Gupta 2-May-14 3:28am    
Your question is not clear. SQL 2000 is not a Code Conversion software.
José Amílcar Casimiro 2-May-14 3:44am    
I doubt very much that this code works. What you need to do?

1 solution

If i understand you well, you can write SP to do that. For example:

SQL
CREATE PROCEDURE GetStock
    @ItemNm INT, @RequestedQty INT
AS
BEGIN

    DECLARE @AvailQty INT

    SELECT @AvailQty = AvailQty
    FROM  StockMF
    WHERE ItemNm = @ItemNm

    IF (@AvailQty < @RequestedQty)
        SELECT 'Not Enough' AS Information
    ELSE
        SELECT 'Enough' AS Information

END


How to call SP? Please see my past anwers[^].
 
Share this answer
 
Comments
_Asif_ 2-May-14 3:54am    
I think its the best response to a question with very little knowledge. +5 :)
Maciej Los 2-May-14 4:07am    
Thank you ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900