Fastest Data Retrieval. VB.net

qwazimoto

Active member
Joined
Oct 20, 2006
Messages
39
Programming Experience
Beginner
Hi people

I am in my first year of programming, Im learning VB.net and I am building a media player using the WMP component. I would like to know which is the best way to store media info given the options of a MS Access data base, or a random access file, or create a structure for each song and add to a collection and serialize the collection, well I guess deserializing is the key, and I guess a .txt file is an option too. I have built some simple media players before but, having 5000 songs it takes a signifigant amount of time to load, and as I understand an MS Access database isnt realy all that reliable for anymore than 4000 rows of data (am I correct with this?).
The Database will need 8 or so columns, structure 8 variables and well if im using a text file I dont really need any advice on that, other than if it is better suited to my application. I have always used txt files for my media players and the results not being all that impresive. I also would like to know how to go about the fastest way of putting this data into a listview box currently I declare a listview item create an array for the data in the listview row and set the Items contents to the array and then add to listview in a for loop...
NOTE:The media information only needs to be read once(when loading)
(any options i miss or am unaware of please tell)

Thanks in advance...:cool:
 
It's not possible for several values to be referenced by a key. All keys must be unique so each key can correspond to only one value. What I'm saying, and exactly what I did say, is that multiple keys may produce the same hash value. That means that multiple items may be stored in the same hash bucket, but each itme still has a unique key. When you retrieve an item you specify the key. The collection hashes the key and goes to the corresponding hash bucket. If only one item is present then it must correspond to the key you specified so the item's value is returned immediately. If the bucket contains multiple items a linear search is performed to find the item with the specified key. Once that key is found the corresponding value is returned.

A Dictionary can use any type as the key and any type as the value. If you want to store arrays then you simply specify the appropriate type as the value type parameter, e.g.
VB.NET:
Dim myDictionary As New Dictionary(Of String, String())
 
Back
Top