Click here to Skip to main content
15,888,089 members
Home / Discussions / C#
   

C#

 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 2:37
Bastar Media18-Sep-15 2:37 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
OriginalGriff18-Sep-15 4:14
mveOriginalGriff18-Sep-15 4:14 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
Gonzoox18-Sep-15 9:29
Gonzoox18-Sep-15 9:29 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
Matt T Heffron18-Sep-15 11:10
professionalMatt T Heffron18-Sep-15 11:10 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 20:05
Bastar Media18-Sep-15 20:05 
GeneralRe: Not Getting Proper Output From Compiled EXE File Pin
Matt T Heffron18-Sep-15 11:12
professionalMatt T Heffron18-Sep-15 11:12 
AnswerRe: Not Getting Proper Output From Compiled EXE File Pin
Wendelius18-Sep-15 20:15
mentorWendelius18-Sep-15 20:15 
General[CAUSE]: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 20:52
Bastar Media18-Sep-15 20:52 
Hi Mika,

As you said I designed a logfile stream writer and now I got my log file full of these two errors:

C#
ERROR: Cannot access a disposed object.
Object name: 'SQLiteConnection'. TARGET: Void CheckDisposed() STACK TRACE: at System.Data.SQLite.SQLiteConnection.CheckDisposed()
   at System.Data.SQLite.SQLiteConnection.get_State()
   at System.Data.SQLite.SQLiteDataReader.CheckClosed()
   at System.Data.SQLite.SQLiteDataReader.Read()
   at PTMS.Classes.Reports.Reporting.WardWiseTax(Int32 WardNumber) in Reporting.cs:line 209
19/09/2015 12:18:39 PM : ERROR: Cannot access a disposed object.
Object name: 'SQLiteConnection'. TARGET: Void CheckDisposed() STACK TRACE: at System.Data.SQLite.SQLiteConnection.CheckDisposed()
   at System.Data.SQLite.SQLiteConnection.get_State()
   at System.Data.SQLite.SQLiteDataReader.CheckClosed()
   at System.Data.SQLite.SQLiteDataReader.Read()
   at PTMS.Classes.Reports.Reporting.WardWiseTax(Int32 WardNumber, Boolean TotalPaid) in Reporting.cs:line 231


And here is the code where I am getting those errors:

C#
private double WardWiseTax(Int32 WardNumber)
        {
            double TT = 0;
            try
            {
                Engine E = new Engine();
                SQLiteCommand CUSTCMD = new SQLiteCommand(E.SelectSQL("CUSTOMERS", "WARDNUMBER"), E.Conn);
                CUSTCMD.Parameters.AddWithValue("WARDNUMBER", WardNumber);
                SQLiteDataReader CUSTRDR = CUSTCMD.ExecuteReader();
                Calculate CT = new Calculate();

                while (CUSTRDR.Read()) // Here is the error (209)
                    TT += CT.LedgerBalance(CUSTRDR["DEMAND"].ToString())[1];

                CUSTCMD.Dispose();
                CUSTRDR.Dispose();
                CT.Dispose();

                return TT;
            }
            catch (Exception ex) { LogEvent.WriteErrorLog(ex); return 0; }
        }
        private double WardWiseTax(Int32 WardNumber, bool TotalPaid)
        {
            double TT = 0;
            try
            {
                Engine E = new Engine();
                SQLiteCommand CUSTCMD = new SQLiteCommand(E.SelectSQL("CUSTOMERS", "WARDNUMBER"), E.Conn);
                CUSTCMD.Parameters.AddWithValue("WARDNUMBER", WardNumber);
                SQLiteDataReader CUSTRDR = CUSTCMD.ExecuteReader();
                Calculate CT = new Calculate();

                while (CUSTRDR.Read()) // Here is the error (231)
                {
                    TT += CT.LedgerBalance(CUSTRDR["DEMAND"].ToString())[2];
                }

                CUSTCMD.Dispose();
                CUSTRDR.Dispose();
                CT.Dispose();

                return (TotalPaid) ? TT : 0;
            }
            catch (Exception ex) { LogEvent.WriteErrorLog(ex); return 0; }
        }


Please help...
GeneralRe: [CAUSE]: Not Getting Proper Output From Compiled EXE File Pin
Wendelius18-Sep-15 21:31
mentorWendelius18-Sep-15 21:31 
GeneralRe: [CAUSE]: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 21:41
Bastar Media18-Sep-15 21:41 
General[SOLVED]: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 21:38
Bastar Media18-Sep-15 21:38 
GeneralRe: [SOLVED]: Not Getting Proper Output From Compiled EXE File Pin
Wendelius18-Sep-15 21:42
mentorWendelius18-Sep-15 21:42 
GeneralRe: [SOLVED]: Not Getting Proper Output From Compiled EXE File Pin
Bastar Media18-Sep-15 21:47
Bastar Media18-Sep-15 21:47 
QuestionNancyFx in OWIN and Windows Service host Pin
LIttle_Cat17-Sep-15 20:25
LIttle_Cat17-Sep-15 20:25 
AnswerRe: NancyFx in OWIN and Windows Service host Pin
Richard Andrew x6418-Sep-15 18:00
professionalRichard Andrew x6418-Sep-15 18:00 
QuestionREST Web API Query JSON Deserialization Pin
FMG Tech17-Sep-15 17:10
FMG Tech17-Sep-15 17:10 
AnswerRe: REST Web API Query JSON Deserialization Pin
Richard MacCutchan17-Sep-15 23:30
mveRichard MacCutchan17-Sep-15 23:30 
GeneralRe: REST Web API Query JSON Deserialization Pin
FMG Tech18-Sep-15 6:34
FMG Tech18-Sep-15 6:34 
GeneralRe: REST Web API Query JSON Deserialization Pin
Richard MacCutchan18-Sep-15 6:49
mveRichard MacCutchan18-Sep-15 6:49 
GeneralRe: REST Web API Query JSON Deserialization Pin
FMG Tech18-Sep-15 15:16
FMG Tech18-Sep-15 15:16 
QuestionEdit SVG text elements of XHTML page with C# Pin
Bartosz Jarmuż17-Sep-15 4:16
Bartosz Jarmuż17-Sep-15 4:16 
Questionc# RSA security Pin
Member 1198796116-Sep-15 20:11
Member 1198796116-Sep-15 20:11 
AnswerRe: c# RSA security Pin
Eddy Vluggen16-Sep-15 22:54
professionalEddy Vluggen16-Sep-15 22:54 
QuestionIn visual studio do you know what the name of this control ? Pin
Member 245846716-Sep-15 16:29
Member 245846716-Sep-15 16:29 
AnswerRe: In visual studio do you know what the name of this control ? Pin
Richard MacCutchan16-Sep-15 21:43
mveRichard MacCutchan16-Sep-15 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.