i have this store procedure and i want to make this that will return the value to asp .net application when it is true or false
=====================================
ALTER proc [dbo].[sp_Stock_check]
@sum int ,@product_id int
as
begin
SELECT product_id
, COUNT(stock_in) as Count_stockIn
, COUNT(stock_out) as Count_stockOut
, SUM(stock_in) as Sum_stockIn
,
SUM(stock_out)+ @sum AS Sum_StockOut,
CASE WHEN SUM(stock_in) >= (SUM(stock_out)+@Sum) THEN 'true' ELSE 'false' END AS IsInGreater
From Stock
Group By product_id
having product_id = @product_id
end


Nitin SontakkeRank #264 · 9.6K reputationPosted Jul 30, 2016, 7:10 PM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Jul 31, 2016, 3:02 AM EDT
Krishna Rajput SinghRank #605 · 4K reputationPosted Jul 30, 2016, 8:08 PM EDT
Imran Bashir120 reputationPosted Jul 30, 2016, 9:16 PM EDT
db.com.CommandType = CommandType.StoredProcedure;
db.com.Parameters.AddWithValue("@product_id",ddlProduct.SelectedValue);
db.com.Parameters.AddWithValue("@sum", txtQuantity.Text);
try
{
res = db.com.ExecuteNonQuery();
lblResult2.Text = "Successfully data enter";
}
catch (Exception ex)
{
lblResult.Text = ex.Message;
}
finally
{
// db.con.Close();
//}