CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    47

    Store procedure returned null value

    I have problem on stored procedure after executing it

    This is the select statement inside the stored procedure:
    select sum(amt) as total from orders where order_Date = today

    The problem occurs when there is no record or orders on a specific date.
    How could I check if the value returned is null or there is no record found in vb.net?

    Hope someone could help me on this. Thanks!!!

  2. #2
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: Store procedure returned null value

    2 solutions:

    in SQL (Ms SQL) for example:
    Code:
     SELECT IsNUll((select sum(amt) as total from orders where order_Date = today),0)
    in VB use .IsNull (as I remember) method of DataReader or DataTable

  3. #3
    Join Date
    Jun 2005
    Posts
    3

    Smile Re: Store procedure returned null value

    SQL Server 2000

    SELECT COALESCE(sum(amt),0) as total from orders where order_Date = today

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured