Best way of generating a lookup table
-
Hi, I have to store a list as an external file of part codes and corresponding descriptions for later retrieval by other applications. What's the best way of doing it? Each entry in the list consists of two strings, a part code and a description. I could just write to a text file and read from it again or should I use XML? Anyone have any ideas or examples of how to implement such code? Thanks :)
-
Hi, I have to store a list as an external file of part codes and corresponding descriptions for later retrieval by other applications. What's the best way of doing it? Each entry in the list consists of two strings, a part code and a description. I could just write to a text file and read from it again or should I use XML? Anyone have any ideas or examples of how to implement such code? Thanks :)
Personally, I always favor XML over a plain text file. First, you can define an additional schema that allows you and other applications to easily validate whether the XML file contains data in a valid format. Second, you can use XPath to easily lookup the description for a part code. Finally, you are probably able to use the XmlSerializer class to easily create the Xml file in your application; depends on the way the you implemented the list to be stored in your application.?
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
Hi, I have to store a list as an external file of part codes and corresponding descriptions for later retrieval by other applications. What's the best way of doing it? Each entry in the list consists of two strings, a part code and a description. I could just write to a text file and read from it again or should I use XML? Anyone have any ideas or examples of how to implement such code? Thanks :)