views:

49

answers:

2

I'm having trouble figuring out databases in VB.NET. (VS 2008)

What control(s) do I need to use and how do I use them? I am ,looking for tutorials and sample code too.

I'm working on a trivia game where the admin can remove and add questions to a database.

EDIT:

The program must be able to do all of the DB interactions itself through code.


Regarding DB portability...

I do not intend to install it on many machines, so portability is not a major issue, but I's rather not be bound to Access or SQL Server. (Is that possible? - A portable database file?)


A bit more complaining... I really need help with connection strings and the whole DB gamut in VB. I've done DBs in PHP so I'm not completely ignorant. It's the VB side of things that's confusing.

Thanks.

+1  A: 

I would suggest Microsoft's Enterprise Library - The hands on labs available make it a breeze to setup access to a database, and can make it as simple as a config change to point to a new/different DB.

Also, check out http://connectionstrings.com/ for related info.

Peter LaComb Jr.
What about portability?
Moshe
It's hard to know what would serve you the best without knowing more about how you intend to build the app, but you could distribute SQL Compact for the database http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx,
Peter LaComb Jr.
+1  A: 

Have you considered SQLite DB? It's a very small DB and is used my many vendors. I have not used SQLite personally, but I do know that Firefox uses it and so does iPhone (from what i've read).

SQLite does not require you to install anything (as per the post below). It's a nice alternative to Access or carrying around SQL Server Express.

If you do decide to use SQL Server Express, you will be required to install the run-time, from here for each machine it's used on.

Below are some links which may help you get started

Google for SQLite DB
ADO.NET 2.0 Provider for SQLite
And finally, here's a blog post outlining how to get it done, and quickly.

Cheers!

Chris