I get this error IErrorInfo.GetDescription failed with E_FAIL(0x80004005)
on this row
oleDBDataAdapter1.SelectCommand=command;
I suppose that the error is in select statement. Here is the codeSELECT NOVI.GBR as gbrnov, NOVI.AB as abnov, NALOG1.DATA as datanov,Min(NALOG1.POCKM) AS MinOfPOCKM, Max(NALOG1.KRAJKM) AS MaxOfKRAJKM,(Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA, (MAGACIN.KOL)/100 AS Potr100km, MAGACIN.SIFRA, (case when [MAGACIN.SIFRA]='0991000' then [MAGACIN.KOL] else null end as 'Gorivo', case when [MAGACIN.SIFRA]='0993050' then [MAGACIN.KOL] else null end as 'Maslo'), NOVI.DATAP AS poslprov, NOVI.DATAS AS poslservis FROM (NALOG1 INNER JOIN MAGACIN ON NALOG1.GBRV=MAGACIN.GBR) INNER JOIN NOVI ON NALOG1.GBRV=NOVI.GBR where ( ( ( (NOVI.GBR)>=? And (NOVI.GBR)<=? ) ) AND ( (NOVI.AB)=? or (NOVI.AB)=?) AND ( ( (NALOG1.DATA)>=?) and ((NALOG1.DATA)<=?) ) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, NOVI.DATAP, NOVI.DATAS
Before I insert the code for MAGACIN.SIFRA and MAGACIN.KOL everything worked fine.
Thanks
NelPosted Nov 16, 2011, 11:42 AM
NelPosted Nov 16, 2011, 11:29 AM
I tried this code but I get the same error again IErrorInfo.GetDescription failed with E_FAIL(0x80004005).
Javeed M ShaikhPosted Nov 16, 2011, 9:48 AM
try this..
SELECT
[NOVI.GBR as gbrnov],
[NOVI.AB as abnov],
[NALOG1.DATA as datanov],
[Min(NALOG1.POCKM) AS MinOfPOCKM],
[Max(NALOG1.KRAJKM) AS MaxOfKRAJKM],
[(Max(NALOG1.KRAJKM)-Min(NALOG1.POCKM)) AS RAZLIKA],
[(MAGACIN.KOL)/100 AS Potr100km],
[MAGACIN.SIFRA],
[(case when [MAGACIN.SIFRA]='0991000' then [MAGACIN.KOL] else null end as 'Gorivo'],
[(case when [MAGACIN.SIFRA]='0993050' then [MAGACIN.KOL] else null end as 'Maslo'],
[NOVI.DATAP AS poslprov],
[NOVI.DATAS AS poslservis]
FROM
(NALOG1 INNER JOIN MAGACIN ON NALOG1.GBRV=MAGACIN.GBR) INNER JOIN NOVI ON NALOG1.GBRV=NOVI.GBR where ( ( ( (NOVI.GBR)>=? And (NOVI.GBR)<=? ) ) AND ( (NOVI.AB)=? or (NOVI.AB)=?) AND ( ( (NALOG1.DATA)>=?) and ((NALOG1.DATA)<=?) ) ) GROUP BY NOVI.GBR, NOVI.AB, NALOG1.DATA, NOVI.DATAP, NOVI.DATAS