Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi ! I want to use an XML files as ressources files (kinda) to store all the error messages of my windows app. Is there a way to get only one record at a time from the XML file (like a Where clause in SQL) or do I have to load the file in a dataset so I can search through it ?

 

Because I think it's a waste of mem space to keep a DataSet filled wih all the error codes at all times....

 

Or if you have a better way to do this, I'm open to all kind of suggestions.

 

Thanks in advance !

Now go on, boy, and pay attention. Because if you do, someday, you may achieve something that we Simpsons have dreamed about for generations: You may outsmart someone!

--Homer Simpson

  • *Experts*
Posted

For JABE's suggestion to work, you'd have to load the whole XML file into memory.

 

The SAX objects may work, though I've never used them. They are made to read in XML asynchronously, so that you only process a node at a time. Never tried it though...

 

Are these app-specific error messages and you're just looking for a way to keep them extracted from the main project? Even a medium sized lookup shouldn't be more than a thousand or so messages. If each message is 100 characters that's only 100k or so (plus baggage for the XML object itself) - maybe a meg on the outside. Given the requirements for .NET itself, I wouldn't think keeping a few of these system type lookups in memory would hurt performance too much.

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Are these app-specific error messages and you're just looking for a way to keep them extracted from the main project?

 

Yes, exactly.

 

So I'll just read it in the Main and keep a DataSet open.

 

It's faster to access then since my DataSet has a primarey key so I can access a line directly with the Find method.

 

Thanks a lot guys !

Now go on, boy, and pay attention. Because if you do, someday, you may achieve something that we Simpsons have dreamed about for generations: You may outsmart someone!

--Homer Simpson

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...