tags:

views:

137

answers:

3

I'm currently learning C# and .NET (coming from a UNIX background), and have just started writing a media player. I was hoping for some suggestions on the best way to store the internal database of songs. SQL? Some kind of text file? I don't really have any experience in this area so all points will be really appreciated.

Cheers!

+4  A: 

You should probably use SQLite, and you can use LINQ on that to take full advantage of C# 3.5.

http://www.codeproject.com/KB/linq/linqToSql_7.aspx

Patrick McCafferty
+1  A: 

There is also SQL Server Compact. Linq to Sql works with this as well.

Darren Kopp
A: 

A more fundamental question should probably be asked before we move along toward recommending one technology over another...

That of architecture. From the brief description above, it seems like what you are building is a Windows Media Player Library-like piece of functionality. If that's the case, the suggestion of a SQL database might seem appropriate, but the complication of synchronization of the filesystem (you weren't planning on turning the media files to be played into a monolithic datastore, were you?)

If you are instead only worried about persisting playlists.... a text-based format seems appropriate.

Playlists might want to be text-based (which, to me, includes XML representations of an object graph), but library information would seem to want to be in a more robust, more queryable datastore.

An object database could also be appropriate, as it lets you work with a much more transparent view of persistence compared to other suggestions. Isolating the number of new topics you're dealing with while you learn can be an important way to manage your learning curve. db4o has a .Net variation that I haven't looked at recently.

Tetsujin no Oni