简体   繁体   中英

Store huge amount of data in assembly

I'm trying to make an assembly which I can use in mutliple programs. The assembly contains a huge amount of countries and a huge amount of towns in that country. the data for countries is not much of a problem because I only count 249 countries but I also have huge amount of data for towns.

For example france has nearly 50.000 towns. Belgium has nearly 2500 towns. United kingdom nearly 150.000 towns. ...

I already have all the data I need but my problem is. I have no idea how to store the data in my assembly. - I tried XML but loading the xml give me performance issues. It takes to long to load the data. - I tried a MS Access database but then the data is store in a database outside my assembly while I try to keep the data inside my assembly. which means thats not my solution to. - I tried loading the data directly in an array in my script but then my visual studio keep loading all day long checking the data I entered but I can't work with it anymore

Anyone can give me a way to store data in my assembly without having these performance issues?

Any help is welcome.

I work with visual studio 2010 in the language C#

If you are determined to hardcode it into an assembly you could go down the route of multiple Dll's containing each country.

They way if you only need to access the France file you can just create an instance of the France class and not the whole world.

you may want to look at geo coding instead. i once used a dat file that had a bunch of US Zip Codes and that info in it. I am sure similar things exist elsewhere.

you may just want to look at google geo coding though.

It wouldnt be a very good idea to keep all that data inside your assembly. 1. It makes it very large. 2. It is difficult to update.

If you are worried about other people seeing the information in a database or xml document outside your assembly you should look into some basic encryption.

EDIT: 1. Having a very large assembly would be a poor idea due to having to load all that information into memory unnecessarly. This is assuming that the program does not need 100% of the information every time it runs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM