PC Review


Reply
Thread Tools Rate Thread

again strange behavior

 
 
Maileen
Guest
Posts: n/a
 
      14th Aug 2005
Hi,

I finished my application butonce again i have some strange behavior
with XML/text functions...

for example, here below is a function which worked perfectly till now
and now generate an error :
"An unhandled exception of type 'System.NullReferenceException' occured
in Unknown Module.
Addition information : object reference not set to an instance of object"
when i click on break, i can not get anymore information, but if i click
on continue, my application works perfectly... :-(

this error is raised after few sw.WriteLine commands...
i have the same issue if i do :

dim doc as XMLDocument
doc = new XMLDocument (here occured error)

where could be the problem ?
from my point of view, some options in application could have such
impact but which ones ?

'-----------------------------------------
' Create_Empty_XML_SLAReport
'-----------------------------------------
' create an empty settings.xml file
Public Function Create_Empty_XML_SLAReport(ByVal sPath As String) As
Boolean
Dim sw As StreamWriter = New StreamWriter("SLAReport.xml")
' Add basic skeleton of file
sw.WriteLine("<?xml version=""1.0""?>")
sw.WriteLine("<SLAReport>")
sw.WriteLine("<SourceFile>")
sw.WriteLine("<Configuration>")
sw.WriteLine("<ParameterIN id=""SLAReportSheetNumber"" type=""int""
description=""SHEET NUMBER in Excel Sheet collection where are stored
all data"">1</ParameterIN>")
sw.WriteLine("<ParameterIN id=""Period"" type=""string""
description=""Period on which report has been done"">A1</ParameterIN>")
sw.WriteLine("<ParameterIN id=""FirstDataRow"" type=""int""
description=""Number of first row which contains data for
reporting"">4</ParameterIN>")
sw.WriteLine("<ParameterIN id=""CancelColumn"" type=""string""
description=""Letter of the column where is written CANCEL
flag"">A</ParameterIN>")
sw.WriteLine("<ParameterIN id=""TypeIssueColumn"" type=""string""
description=""Letter of the column which contains Request or
Order"">B</ParameterIN>")
sw.WriteLine("<ParameterIN id=""EvidenceDateColumn""
type=""string"" description=""Letter of the column where is written DATE
of EVIDENCE"">C</ParameterIN>")
sw.WriteLine("<ParameterIN id=""EvidenceNumberColumn""
type=""string"" description=""Letter of the column where is written
NUMBER of EVIDENCE"">D</ParameterIN>")
sw.WriteLine("<ParameterIN id=""CustomerNameColumn""
type=""string"" description=""Letter of the column where is written
CUSTOMER NAME"">E</ParameterIN>")
sw.WriteLine("<ParameterIN id=""TaskDescriptionColumn""
type=""string"" description=""Letter of the column where is written TASK
DESCRIPTION"">F</ParameterIN>")
sw.WriteLine("<ParameterIN id=""DeadlineDateColumn""
type=""string"" description=""Letter of the column where is written
DEADLINE DATE when should be solved issue"">G</ParameterIN>")
sw.WriteLine("<ParameterIN id=""SolvingDateColumn"" type=""string""
description=""Letter of the column where is written DATE when issue was
SOLVED"">H</ParameterIN>")
sw.WriteLine("<ParameterIN id=""SolutionDescriptionColumn""
type=""string"" description=""Letter of the column where is written
SOLUTION DESCRIPTION"">I</ParameterIN>")
sw.WriteLine("<ParameterIN id=""ModuleColumn"" type=""string""
description=""Letter of the column where is written MODULE
name"">J</ParameterIN>")
sw.WriteLine("<ParameterIN id=""SLANumberColumn"" type=""string""
description=""Letter of the column where is written SLA
CATEGORY"">K</ParameterIN>")
sw.WriteLine("<ParameterIN id=""DivisionColumn"" type=""string""
description=""Letter of the column where is written DIVISION
NAME"">L</ParameterIN>")
sw.WriteLine("<ParameterIN id=""SupplierColumn"" type=""string""
description=""Letter of the column where is written SUPPLIER
NAME"">M</ParameterIN>")
sw.WriteLine("<ParameterIN id=""CompanyColumn"" type=""string""
description=""Letter of the column where is written COMPANY
NAME"">N</ParameterIN>")
sw.WriteLine("</Configuration>")
sw.WriteLine("</SourceFile>")
sw.WriteLine("<OutputFile>")
sw.WriteLine("<ParameterOUT id=""test 3"">A 3rd test</ParameterOUT>")
'sw.WriteLine("</ParameterOUT>")
sw.WriteLine("<TemplateFile>")
sw.WriteLine("</TemplateFile>")
sw.WriteLine("</OutputFile>")
sw.WriteLine("</SLAReport>")
sw.Close()
End Function
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      14th Aug 2005
Hi,

I dont know why you are getting the error at the new xmldocument
line. I would use the xmltextwriter class to write the xml document instead
of a streamwriter.

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
--------------------------
"Maileen" <(E-Mail Removed)> wrote in message
news:ueN%(E-Mail Removed)...
> Hi,
>
> I finished my application butonce again i have some strange behavior with
> XML/text functions...
>
> for example, here below is a function which worked perfectly till now and
> now generate an error :
> "An unhandled exception of type 'System.NullReferenceException' occured in
> Unknown Module.
> Addition information : object reference not set to an instance of object"
> when i click on break, i can not get anymore information, but if i click
> on continue, my application works perfectly... :-(
>
> this error is raised after few sw.WriteLine commands...
> i have the same issue if i do :
>
> dim doc as XMLDocument
> doc = new XMLDocument (here occured error)
>
> where could be the problem ?
> from my point of view, some options in application could have such impact
> but which ones ?
>
> '-----------------------------------------
> ' Create_Empty_XML_SLAReport
> '-----------------------------------------
> ' create an empty settings.xml file
> Public Function Create_Empty_XML_SLAReport(ByVal sPath As String) As
> Boolean
> Dim sw As StreamWriter = New StreamWriter("SLAReport.xml")
> ' Add basic skeleton of file
> sw.WriteLine("<?xml version=""1.0""?>")
> sw.WriteLine("<SLAReport>")
> sw.WriteLine("<SourceFile>")
> sw.WriteLine("<Configuration>")
> sw.WriteLine("<ParameterIN id=""SLAReportSheetNumber"" type=""int""
> description=""SHEET NUMBER in Excel Sheet collection where are stored all
> data"">1</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""Period"" type=""string""
> description=""Period on which report has been done"">A1</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""FirstDataRow"" type=""int""
> description=""Number of first row which contains data for
> reporting"">4</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""CancelColumn"" type=""string""
> description=""Letter of the column where is written CANCEL
> flag"">A</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""TypeIssueColumn"" type=""string""
> description=""Letter of the column which contains Request or
> Order"">B</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""EvidenceDateColumn"" type=""string""
> description=""Letter of the column where is written DATE of
> EVIDENCE"">C</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""EvidenceNumberColumn"" type=""string""
> description=""Letter of the column where is written NUMBER of
> EVIDENCE"">D</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""CustomerNameColumn"" type=""string""
> description=""Letter of the column where is written CUSTOMER
> NAME"">E</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""TaskDescriptionColumn""
> type=""string"" description=""Letter of the column where is written TASK
> DESCRIPTION"">F</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""DeadlineDateColumn"" type=""string""
> description=""Letter of the column where is written DEADLINE DATE when
> should be solved issue"">G</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""SolvingDateColumn"" type=""string""
> description=""Letter of the column where is written DATE when issue was
> SOLVED"">H</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""SolutionDescriptionColumn""
> type=""string"" description=""Letter of the column where is written
> SOLUTION DESCRIPTION"">I</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""ModuleColumn"" type=""string""
> description=""Letter of the column where is written MODULE
> name"">J</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""SLANumberColumn"" type=""string""
> description=""Letter of the column where is written SLA
> CATEGORY"">K</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""DivisionColumn"" type=""string""
> description=""Letter of the column where is written DIVISION
> NAME"">L</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""SupplierColumn"" type=""string""
> description=""Letter of the column where is written SUPPLIER
> NAME"">M</ParameterIN>")
> sw.WriteLine("<ParameterIN id=""CompanyColumn"" type=""string""
> description=""Letter of the column where is written COMPANY
> NAME"">N</ParameterIN>")
> sw.WriteLine("</Configuration>")
> sw.WriteLine("</SourceFile>")
> sw.WriteLine("<OutputFile>")
> sw.WriteLine("<ParameterOUT id=""test 3"">A 3rd test</ParameterOUT>")
> 'sw.WriteLine("</ParameterOUT>")
> sw.WriteLine("<TemplateFile>")
> sw.WriteLine("</TemplateFile>")
> sw.WriteLine("</OutputFile>")
> sw.WriteLine("</SLAReport>")
> sw.Close()
> End Function



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help: Strange, Strange Behavior ( Not Me. My Model! ) SteveM Microsoft Excel Programming 2 16th Dec 2007 06:02 PM
VBA - Strange behavior =?Utf-8?B?TVZN?= Microsoft Excel Programming 0 12th Jun 2006 07:44 PM
Strange TAB behavior m davidson Microsoft Excel Programming 4 28th May 2006 06:09 PM
Re: Strange Behavior =?Utf-8?B?SmF5?= Microsoft Access Form Coding 0 17th Feb 2005 04:57 PM
Strange VBE Behavior Jeff Robson Microsoft Excel Discussion 4 14th Jan 2005 10:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:47 AM.