Link to home
Start Free TrialLog in
Avatar of BIKASH patra
BIKASH patra

asked on

call procedure mysql vb.net fatal error how to solve

Dim ds As DataSet = dbc.data("CALL sv_Int_months_final1 ();")
Avatar of ste5an
ste5an
Flag of Germany image

Well, do you really think you've provided enough information???

What data type is dbc? While it sounds like DataBaseContext, I'm not aware of a data() method..
What error or exception do you get?
Avatar of BIKASH patra
BIKASH patra

ASKER

Public Function data(ByVal sql As String) As DataSet
     

            Try

                execute(sql)
                ds = New DataSet()
                da.SelectCommand = cmd
                resp = 0      
                da.Fill(ds)
                Return ds
             
            Catch ex As Exception

            End Try
     
    End Function
Without testing: This cannot fail. Cause you're swalling any exception.

And please: Use the CODE button..

p.s. the snippet is incomplete. It uses variables declared out-side of the methods scope (da, ds).
CREATE DEFINER=`root`@`localhost` PROCEDURE `sv_Int_months_final1`()
    NO SQL
begin
declare bal_On_dt,cr_on_dt,baldt,crdt,backft,over_cr_dt,over_dr_dt date;
declare total_amt,ten_day_cr,ten_day_dr,after_cr,after_dr,total_cr,total_dr,curr_cr,curr_dr,total_cr_bal,total_dr_bal,prev_bal,prev_cry,cr_bal,dr_bal,ba,intrst_amt,crry double(10,2);
declare cry_frwd_cr_curr,cry_frwd_dr,total_cry_frwd,bal,dr_amt,over_cr,over_cry_frwd,under_cry_frwd,cry_frwd_cr_prev,cry_frwd_dr_prev,over_dr double(10,2);
declare accno,intrst,paymode varchar(20);
declare curr_cr_chk,curr_dr_chk,curr_tcr double(20,2);
declare refno,row,maxid int(250);
declare t10,d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,d18,d19,d20,d21 int(250);
declare vchno varchar(250);
DECLARE done INT DEFAULT FALSE;
declare cur cursor for select da.acc_no,sv.interest,sv.payment_mode from deposit_acc da,sv where (da.acc_type='sv' or da.acc_type='pension') and da.acc_type_code=sv.code ;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE = TRUE;

select max(balance_on),max(intrst_cr_dt),max(ref_no)  into bal_on_dt,cr_on_dt,refno from interest_cr_dt where payment_mode='Monthly';

OPEN cur;
  cur_loop :loop
    FETCH cur into accno,intrst,paymode;
    if done then
       leave cur_loop;
    end if;
     
    set baldt=date_add(bal_on_dt,interval 1 month);
    set crdt=date_add(cr_on_dt,interval 1 month);

             select ifnull(sum(cr),0) into total_cr from voucher where acc_no=accno and date>=baldt and date<=Last_day(crdt);  
                   select ifnull(sum(dr),0) into total_dr from voucher where acc_no=accno and date>=baldt and date<=Last_day(crdt);  
      
       

      select ifnull(sum(cry),0) into prev_cry from savingsintrst_monthly where acc_no=accno and  date=last_day(cr_on_dt);

select ifnull(prev_cry+sum(cr)-sum(dr),prev_cry) into t10 from voucher where acc_no=accno and date>=baldt and date<=date_add(baldt,interval 9 day);
DELETE FROM `sv_int_q` WHERE 1;
INSERT INTO `sv_int_q`(`amt`, `date`) select sum((@total:=@total + cr-dr)+ prev_cry) as amt,date from voucher,(SELECT @total:= 0) AS total where acc_no=accno and date>=baldt and date<=date_add(baldt,interval 31 day) group by date;

select ifnull(min(amt),prev_cry) into d2 from sv_int_q where  date>=date_add(baldt,interval 10 day) and date<=date_add(baldt,interval 31 day);

      
      select LEAST(t10,d2) into ba;


      set ba=ba;

      set crry=total_cr+prev_cry-total_dr;
      
      
      insert into savingsintrst_monthly values(accno,last_day(crdt),paymode,ba,crry);

    end loop cur_loop;
   close cur;

      insert into interest_cr_dt(balance_on,intrst_cr_dt,ref_no,payment_mode)
         values(baldt,Last_day(crdt),refno,'Monthly');

end

Create a Procedures .. Call in vb.net throw .  Problem Fatal error Solve now Plz
I am Calling Mysql server But No problem .
I am Using Vb.net throw Calling But Message Fatal error encounted during command execution
Again: Your code in VB.NET swallows any exception. You still don't use the CODE button. You still haven't posted any exception relevant information.
All information Provided to you.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.