Unfortunately, stack trace from the debugger is not very helpful.
It just shows us your app and we already know which line caused the
problem.
Here are my suggestions:
1. Hard reset the device (which one is it, by the way?) and reinstall
CF
(if possible).
2. Make sure you have CF SP2 installed on the device.
3. Remove exception handling and allow exception to be unhandled. Run app
without debugger. In that case you'll get a stack trace inside CF libs.
4. Try writing some text to the file using System.IO.
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Jim H" <
[email protected]>
References: <
[email protected]>
<
[email protected]>
<
[email protected]>
<
[email protected]>
Subject: Re: Problem with DataSet.WriteXml
Date: Tue, 21 Sep 2004 22:25:13 -0400
Lines: 157
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: crlspr-24.233.164.226.myacc.net 24.233.164.226
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:61699
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
Tried using System.Xml.XmlTextWriter("\\test.xml", null ); and still get
the
same exception.
Here's the stack
CELogger.dll!AvtInterface.DataLogFile.SaveTableToXmlFile() Line 284 C#
CELogger.dll!AvtInterface.DataLogFile.WriteResultsToFile() Line 180 C#
CELogger.dll!AvtInterface.DataLogFile.set_LogToFile(bool value = false)
Line 65 + 0x6 bytes C#
CELogger.dll!AvtInterface.RapidPacketLogger.StopLogging() Line 178
C#
PocketLogger.exe!PocketLogger.Form1.OnStopClick(System.Object sender =
{Text="Stop"}, System.EventArgs e = {System.EventArgs}) Line 217 C#
The SaveTableToXmlFile method contains the code from the beginning of
this
message.
Using DataSet.WriteXml(\\test.xml) throws an IOException on the same
line.
The file was created but is 0 length.
Here's the stack:
CELogger.dll!AvtInterface.DataLogFile.SaveTableToXmlFile() Line 285 C#
CELogger.dll!AvtInterface.DataLogFile.WriteResultsToFile() Line 180 C#
CELogger.dll!AvtInterface.DataLogFile.set_LogToFile(bool value = false)
Line 65 + 0x6 bytes C#
CELogger.dll!AvtInterface.RapidPacketLogger.StopLogging() Line 178
C#
PocketLogger.exe!PocketLogger.Form1.OnStopClick(System.Object sender =
{Text="Stop"}, System.EventArgs e = {System.EventArgs}) Line 217 C#
There has to be a way to do this.
jim
Let's try it without encoding:
lDbFile = new System.Xml.XmlTextWriter("\\test.xml", null );
Or, (not exactly the same) how about this:
lDataSet.WriteXml("\\foo.xml");
Also, do you have the stack trace for this exception?
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Jim H" <
[email protected]>
References: <
[email protected]>
<
[email protected]>
Subject: Re: Problem with DataSet.WriteXml
Date: Tue, 21 Sep 2004 17:00:00 -0400
Lines: 84
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: crlspr-24.233.164.226.myacc.net 24.233.164.226
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:61684
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
Nope, still the same error.
Also, that same filename selection portion of the code works for
another
text file it creates, so I don't think it has anything to do with the
filename. But, I did try it like you had it to make sure.
Any other ideas?
jim
I would suspect bad file name is entered. Please try this:
lDbFile = new System.Xml.XmlTextWriter("\\test.xml",
System.Text.Encoding.ASCII);
Best regards,
Ilya
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Jim H" <
[email protected]>
Subject: Problem with DataSet.WriteXml
Date: Tue, 21 Sep 2004 09:21:37 -0400
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <
[email protected]>
Newsgroups: microsoft.public.dotnet.framework.compactframework
NNTP-Posting-Host: crlspr-24.233.164.226.myacc.net
24.233.164.226
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
phx.gbl
Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:61646
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
I am getting the following error from a call to DataSet.WriteXml():
'System.InvalidOperationException' occurred in mscorlib.dll
The code works fine on the desktop version of the program. Any
ideas
what
I'm doing wrong?
Thanks in advance,
jim
Here's the code:
string lsFileName = string.Empty;
DialogResult lResult;
lResult = lFileDialog.ShowDialog();
if(DialogResult.OK == lResult && string.Empty !=
lFileDialog.FileName)
{
lsFileName = lFileDialog.FileName;
if(Path.GetExtension(lsFileName) != ".xml")
lsFileName += ".xml";
lDbFile = new System.Xml.XmlTextWriter(lsFileName,
System.Text.Encoding.ASCII);
lDbFile.Formatting = System.Xml.Formatting.Indented;
lbReturnCode = true;
}
DataSet lDataSet = new DataSet("DataResults");
lDataSet.Tables.Add(m_ResultsTable);
lDataSet.WriteXml(lDbFile, XmlWriteMode.WriteSchema); //This
line
throws
exception
lDbFile.Close();
//lDbFile = null;
lDataSet.Tables.Remove(m_ResultsTable);
lDataSet = null;