This only returned the results from the last row. No matter how I simplified it (I removed the joins and everything else to make it as simple as possible, and still no go). On another note, if anyone has any other ways of doing this that don't involve cursors, I'd appreciate the help.
-wraith808
That's because you're selecting into a scalar variable, and then selecting out its (one!) value. Try just this:
SELECT gt.description
FROM GameTags gt JOIN Game2Tag g2g ON
gt.keygametag = g2g.keygametag
WHERE g2g.keygame = 1
Note that you're *not* going to get back a comma-separate list, you're going to get back a datatable. There's no standard SQL way to get that CSV list (and I say that with some authority, it's not just that I don't know how, I'm sure there's no *standard* answer). In SQL Server there's an undocumented feature that will get it (but I avoid such, so I don't recall). There's also a way you can use the XML facility to generate it, but it seems awful heavy-weight for such an operation. Or, of course, the cursor approach that you ruled out. The best answer, I think, is to just get the datatable and let your C# code transform the data as necessary. Use the DB for persistence, and handle presentation (i.e., putting things into pretty lists) higher in your architecture.
EDIT: or, as you mention, you might be able to do it with a recursive CTE, but that's (a) nonstandard SQL, and (B) non-supported here anyway.
For some reason, the table adapter was created, but it was not exposed in the dataset, so I had to hack it.
-wraith808
I can't tell if this is definitely your problem, but I've had a lot of trouble with "quirks" in the DB-related visual designers of Visual Studio. In particular, table mapping have been a problem for me. I frequently need to regenerate the whole thing when all I want is to change a single entry in it.
Anyway, thanks for this review. I've considered VistaDB, so seeing a step-by-step in-depth review is very interesting to me.