Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
GeneralRe: Simple windows application. Pin
Torsten Mauz25-Nov-04 13:15
Torsten Mauz25-Nov-04 13:15 
GeneralRe: Simple windows application. Pin
Robin Panther26-Nov-04 5:00
Robin Panther26-Nov-04 5:00 
GeneralRe: Simple windows application. Pin
Anonymous28-Nov-04 11:27
Anonymous28-Nov-04 11:27 
GeneralHandheld device image downloading and saving Pin
kenes25-Nov-04 12:18
kenes25-Nov-04 12:18 
GeneralImage resource management Pin
black02ep325-Nov-04 8:28
black02ep325-Nov-04 8:28 
GeneralRe: Image resource management Pin
Alex Korchemniy25-Nov-04 10:32
Alex Korchemniy25-Nov-04 10:32 
GeneralRe: Image resource management Pin
black02ep325-Nov-04 11:11
black02ep325-Nov-04 11:11 
GeneralXmlDataDocument problem Pin
QzRz25-Nov-04 8:14
QzRz25-Nov-04 8:14 
Hi...

I have made an listbox and a button to save the items inside the listbox into an xml document.

My code looks like this -->

System.Xml.XmlDataDocument data = new System.Xml.XmlDataDocument();
string CurrentUser = "someone";
string xml;
int count = this.listBoxMusik.Items.Count;
xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
xml += "<GreenSheep>";
xml += "<bruger>" + CurrentUser + "</bruger>";
xml += "<dato>" + DateTime.Now.ToLongDateString() + "</dato>";
xml += "<tid>" + DateTime.Now.ToLongTimeString() + "</tid>";
xml += "<sang>";
for(int i = 0; i < count; i++)
{
xml += "<nummer id=\"" + i.ToString() + "\">" + this.listBoxMusik.Items[i].ToString() + "</nummer>";
}
xml += "</sang>";
xml += "</GreenSheep>";
data.LoadXml(xml);
data.Save(@c:\);
data.RemoveAll();

this work great when i have about 10-20 items in the listbox, but if i add about 1200 items it trows an error!
System.Xml.XmlException: An error occurred while parsing EntityName Line 1, position 7691.

Can anyone tell me why this error comes when i add more than 1000 items?

thanks!


QzRz
GeneralRe: XmlDataDocument problem Pin
Alex Korchemniy25-Nov-04 10:11
Alex Korchemniy25-Nov-04 10:11 
GeneralRe: XmlDataDocument problem Pin
QzRz26-Nov-04 2:14
QzRz26-Nov-04 2:14 
GeneralRe: XmlDataDocument problem Pin
Alex Korchemniy26-Nov-04 8:13
Alex Korchemniy26-Nov-04 8:13 
GeneralRegistry Pin
picasso225-Nov-04 8:02
picasso225-Nov-04 8:02 
GeneralRe: Registry Pin
Alex Korchemniy25-Nov-04 10:22
Alex Korchemniy25-Nov-04 10:22 
GeneralRe: Registry Pin
Robin Panther26-Nov-04 4:46
Robin Panther26-Nov-04 4:46 
GeneralWeb Browser Document event handling Pin
eliea25-Nov-04 7:27
eliea25-Nov-04 7:27 
GeneralRe: Web Browser Document event handling Pin
Alex Korchemniy25-Nov-04 10:43
Alex Korchemniy25-Nov-04 10:43 
GeneralRe: Web Browser Document event handling Pin
eliea25-Nov-04 19:45
eliea25-Nov-04 19:45 
GeneralRe: Web Browser Document event handling Pin
eliea26-Nov-04 22:06
eliea26-Nov-04 22:06 
GeneralRe: Web Browser Document event handling Pin
Alex Korchemniy27-Nov-04 9:51
Alex Korchemniy27-Nov-04 9:51 
GeneralRe: Web Browser Document event handling Pin
eliea29-Nov-04 1:07
eliea29-Nov-04 1:07 
GeneralRe: Web Browser Document event handling Pin
eliea29-Nov-04 8:06
eliea29-Nov-04 8:06 
Generaldirectx sdk Pin
cmarmr25-Nov-04 7:27
cmarmr25-Nov-04 7:27 
GeneralPagging dataset and rebind controls Pin
Kris{PL}25-Nov-04 5:09
Kris{PL}25-Nov-04 5:09 
GeneralHashtables and foreach loops: Pin
HahnTech25-Nov-04 4:42
HahnTech25-Nov-04 4:42 
GeneralRe: Hashtables and foreach loops: Pin
Daniel Grunwald25-Nov-04 6:31
Daniel Grunwald25-Nov-04 6:31 

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.