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 ();")
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
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).
And please: Use the CODE button..
p.s. the snippet is incomplete. It uses variables declared out-side of the methods scope (da, ds).
ASKER
CREATE DEFINER=`root`@`localhost` PROCEDURE `sv_Int_months_final1`()
NO SQL
begin
declare bal_On_dt,cr_on_dt,baldt,c rdt,backft ,over_cr_d t,over_dr_ dt date;
declare total_amt,ten_day_cr,ten_d ay_dr,afte r_cr,after _dr,total_ cr,total_d r,curr_cr, curr_dr,to tal_cr_bal ,total_dr_ bal,prev_b al,prev_cr y,cr_bal,d r_bal,ba,i ntrst_amt, crry double(10,2);
declare cry_frwd_cr_curr,cry_frwd_ dr,total_c ry_frwd,ba l,dr_amt,o ver_cr,ove r_cry_frwd ,under_cry _frwd,cry_ frwd_cr_pr ev,cry_frw d_dr_prev, over_dr double(10,2);
declare accno,intrst,paymode varchar(20);
declare curr_cr_chk,curr_dr_chk,cu rr_tcr double(20,2);
declare refno,row,maxid int(250);
declare t10,d1,d2,d3,d4,d5,d6,d7,d 8,d9,d10,d 11,d12,d13 ,d14,d15,d 16,d17,d18 ,d19,d20,d 21 int(250);
declare vchno varchar(250);
DECLARE done INT DEFAULT FALSE;
declare cur cursor for select da.acc_no,sv.interest,sv.p ayment_mod e 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),ma x(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,i nterval 1 month);
set crdt=date_add(cr_on_dt,int erval 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)-su m(dr),prev _cry) into t10 from voucher where acc_no=accno and date>=baldt and date<=date_add(baldt,inter val 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,inter val 31 day) group by date;
select ifnull(min(amt),prev_cry) into d2 from sv_int_q where date>=date_add(baldt,inter val 10 day) and date<=date_add(baldt,inter val 31 day);
select LEAST(t10,d2) into ba;
set ba=ba;
set crry=total_cr+prev_cry-tot al_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_mo de)
values(baldt,Last_day(crdt ),refno,'M onthly');
end
Create a Procedures .. Call in vb.net throw . Problem Fatal error Solve now Plz
NO SQL
begin
declare bal_On_dt,cr_on_dt,baldt,c
declare total_amt,ten_day_cr,ten_d
declare cry_frwd_cr_curr,cry_frwd_
declare accno,intrst,paymode varchar(20);
declare curr_cr_chk,curr_dr_chk,cu
declare refno,row,maxid int(250);
declare t10,d1,d2,d3,d4,d5,d6,d7,d
declare vchno varchar(250);
DECLARE done INT DEFAULT FALSE;
declare cur cursor for select da.acc_no,sv.interest,sv.p
DECLARE CONTINUE HANDLER FOR NOT FOUND SET DONE = TRUE;
select max(balance_on),max(intrst
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,i
set crdt=date_add(cr_on_dt,int
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)-su
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,inter
select ifnull(min(amt),prev_cry) into d2 from sv_int_q where date>=date_add(baldt,inter
select LEAST(t10,d2) into ba;
set ba=ba;
set crry=total_cr+prev_cry-tot
insert into savingsintrst_monthly values(accno,last_day(crdt
end loop cur_loop;
close cur;
insert into interest_cr_dt(balance_on,
values(baldt,Last_day(crdt
end
Create a Procedures .. Call in vb.net throw . Problem Fatal error Solve now Plz
ASKER
I am Calling Mysql server But No problem .
I am Using Vb.net throw Calling But Message Fatal error encounted during command execution
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.
ASKER
All information Provided to you.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers 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.
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?