Riaz Hussain

Riaz Hussain

  • NA
  • 19
  • 301

How to call SQL procedure in c# without parameters

May 13 2020 10:35 PM
I made a table whrere from I want to get sum of total days (din) group by PtR number. here is query:
  1. ALTER PROCEDURE getdays  
  2. @tr_ptr nvarchar(6), @tr_din nvarchar(2), @Total int output  
  3. AS  
  4. BEGIN  
  5. SELECT Total = SUM (CONVERT(int, tr_din)) FROM Treatments GROUP BY tr_ptr  
  6. END  
I want to get sum result in my label of form by clicking the button, please guide me how to complete this job

Answers (1)