How to call stored procedure in vb?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akocjello
    New Member
    • Jan 2013
    • 5

    #1

    How to call stored procedure in vb?

    this is my stored procedure... how can i get the value of a datetimepicker1 in vb.net form and stored it in @date1 and @date2
    Code:
    CREATE PROCEDURE SAT
    	
    	@date1 datetime,
    	@date2 datetime
    AS
    	
    	SELECT DISTINCT cnsgne, broker,
    		COUNT(case when cntsze=20 then cntsze end) as '20',
    		COUNT(case when cntsze=40 then cntsze end) as '40',
    		COUNT(case when cntsze=45 then cntsze end) as '45'
    	FROM CYMgps
    	WHERE (sysdte BETWEEN @date1 and @date2)
    	GROUP BY cnsgne, broker
    	ORDER BY cnsgne asc
    	RETURN
Working...