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.NullRef erenceException ' 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_XM L_SLAReport
'-----------------------------------------
' create an empty settings.xml file
Public Function Create_Empty_XM L_SLAReport(ByV al sPath As String) As
Boolean
Dim sw As StreamWriter = New StreamWriter("S LAReport.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=""SLAReportS heetNumber"" type=""int""
description=""S HEET NUMBER in Excel Sheet collection where are stored
all data"">1</ParameterIN>")
sw.WriteLine("< ParameterIN id=""Period"" type=""string""
description=""P eriod on which report has been done"">A1</ParameterIN>")
sw.WriteLine("< ParameterIN id=""FirstDataR ow"" type=""int""
description=""N umber of first row which contains data for
reporting"">4</ParameterIN>")
sw.WriteLine("< ParameterIN id=""CancelColu mn"" type=""string""
description=""L etter of the column where is written CANCEL
flag"">A</ParameterIN>")
sw.WriteLine("< ParameterIN id=""TypeIssueC olumn"" type=""string""
description=""L etter of the column which contains Request or
Order"">B</ParameterIN>")
sw.WriteLine("< ParameterIN id=""EvidenceDa teColumn""
type=""string"" description=""L etter of the column where is written DATE
of EVIDENCE"">C</ParameterIN>")
sw.WriteLine("< ParameterIN id=""EvidenceNu mberColumn""
type=""string"" description=""L etter of the column where is written
NUMBER of EVIDENCE"">D</ParameterIN>")
sw.WriteLine("< ParameterIN id=""CustomerNa meColumn""
type=""string"" description=""L etter of the column where is written
CUSTOMER NAME"">E</ParameterIN>")
sw.WriteLine("< ParameterIN id=""TaskDescri ptionColumn""
type=""string"" description=""L etter of the column where is written TASK
DESCRIPTION"">F </ParameterIN>")
sw.WriteLine("< ParameterIN id=""DeadlineDa teColumn""
type=""string"" description=""L etter of the column where is written
DEADLINE DATE when should be solved issue"">G</ParameterIN>")
sw.WriteLine("< ParameterIN id=""SolvingDat eColumn"" type=""string""
description=""L etter of the column where is written DATE when issue was
SOLVED"">H</ParameterIN>")
sw.WriteLine("< ParameterIN id=""SolutionDe scriptionColumn ""
type=""string"" description=""L etter of the column where is written
SOLUTION DESCRIPTION"">I </ParameterIN>")
sw.WriteLine("< ParameterIN id=""ModuleColu mn"" type=""string""
description=""L etter of the column where is written MODULE
name"">J</ParameterIN>")
sw.WriteLine("< ParameterIN id=""SLANumberC olumn"" type=""string""
description=""L etter of the column where is written SLA
CATEGORY"">K</ParameterIN>")
sw.WriteLine("< ParameterIN id=""DivisionCo lumn"" type=""string""
description=""L etter of the column where is written DIVISION
NAME"">L</ParameterIN>")
sw.WriteLine("< ParameterIN id=""SupplierCo lumn"" type=""string""
description=""L etter of the column where is written SUPPLIER
NAME"">M</ParameterIN>")
sw.WriteLine("< ParameterIN id=""CompanyCol umn"" type=""string""
description=""L etter 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 1 1182
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" <no*****@nospam .com> wrote in message
news:ue******** ********@TK2MSF TNGP15.phx.gbl. .. 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.NullRef erenceException ' 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_XM L_SLAReport '----------------------------------------- ' create an empty settings.xml file Public Function Create_Empty_XM L_SLAReport(ByV al sPath As String) As Boolean Dim sw As StreamWriter = New StreamWriter("S LAReport.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=""SLAReportS heetNumber"" type=""int"" description=""S HEET NUMBER in Excel Sheet collection where are stored all data"">1</ParameterIN>") sw.WriteLine("< ParameterIN id=""Period"" type=""string"" description=""P eriod on which report has been done"">A1</ParameterIN>") sw.WriteLine("< ParameterIN id=""FirstDataR ow"" type=""int"" description=""N umber of first row which contains data for reporting"">4</ParameterIN>") sw.WriteLine("< ParameterIN id=""CancelColu mn"" type=""string"" description=""L etter of the column where is written CANCEL flag"">A</ParameterIN>") sw.WriteLine("< ParameterIN id=""TypeIssueC olumn"" type=""string"" description=""L etter of the column which contains Request or Order"">B</ParameterIN>") sw.WriteLine("< ParameterIN id=""EvidenceDa teColumn"" type=""string"" description=""L etter of the column where is written DATE of EVIDENCE"">C</ParameterIN>") sw.WriteLine("< ParameterIN id=""EvidenceNu mberColumn"" type=""string"" description=""L etter of the column where is written NUMBER of EVIDENCE"">D</ParameterIN>") sw.WriteLine("< ParameterIN id=""CustomerNa meColumn"" type=""string"" description=""L etter of the column where is written CUSTOMER NAME"">E</ParameterIN>") sw.WriteLine("< ParameterIN id=""TaskDescri ptionColumn"" type=""string"" description=""L etter of the column where is written TASK DESCRIPTION"">F </ParameterIN>") sw.WriteLine("< ParameterIN id=""DeadlineDa teColumn"" type=""string"" description=""L etter of the column where is written DEADLINE DATE when should be solved issue"">G</ParameterIN>") sw.WriteLine("< ParameterIN id=""SolvingDat eColumn"" type=""string"" description=""L etter of the column where is written DATE when issue was SOLVED"">H</ParameterIN>") sw.WriteLine("< ParameterIN id=""SolutionDe scriptionColumn "" type=""string"" description=""L etter of the column where is written SOLUTION DESCRIPTION"">I </ParameterIN>") sw.WriteLine("< ParameterIN id=""ModuleColu mn"" type=""string"" description=""L etter of the column where is written MODULE name"">J</ParameterIN>") sw.WriteLine("< ParameterIN id=""SLANumberC olumn"" type=""string"" description=""L etter of the column where is written SLA CATEGORY"">K</ParameterIN>") sw.WriteLine("< ParameterIN id=""DivisionCo lumn"" type=""string"" description=""L etter of the column where is written DIVISION NAME"">L</ParameterIN>") sw.WriteLine("< ParameterIN id=""SupplierCo lumn"" type=""string"" description=""L etter of the column where is written SUPPLIER NAME"">M</ParameterIN>") sw.WriteLine("< ParameterIN id=""CompanyCol umn"" type=""string"" description=""L etter 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Martin Jørgensen |
last post by:
Hi,
I'm relatively new with C-programming and even though I've read about
pointers and arrays many times, it's a topic that is a little confusing
to me - at least at this moment:
----
1) What's the difference between these 3 statements:
(i) memcpy(&b, &KoefD, n); // this works somewhere in my code
|
by: Joseph Geretz |
last post by:
Writing an Outlook AddIn with C#. For the user interface within Outlook I'm
adding matching pairs of Toolbar buttons and Menu items. All of the buttons
and menu items are wired up to send events to the same method (aka
delegate?). I use the Tag property within this method to determine what user
action is taking place. Very simple:
When adding toolbar button:
tbButton.Click += new...
|
by: sara |
last post by:
Very strange behavior, but I suspect some is A2K and some might be for
me to correct. Just trying to see if anyone can help and advise.
We have a database that's been running for a few years with no
problems. We continuously add queries and reports. We're up to about
700 queries (no, not all are used and most are parameter queries - the
business asks a LOT of questions!), and under 250 reports and fewer
than 15 forms.
Data is...
|
by: Pilcrow |
last post by:
This behavior seems very strange to me, but I imagine that someone will
be able to 'explain' it in terms of the famous C standard.
-------------------- code -----------------------------------
#include <stdio.h>
int main (void)
{
char xx="abcd";
char * p1 = xx;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |