Getting the first record from a
is not a hard thing to do. Simply access row 0 only. That would look something like this:
var row = DataSet.DataTables.Rows;
That will give you a
that contains the first record from the first table in the
. You could do this for each of your four tables. Then you could create a new
and insert these four rows into it. The key here though would be that the four rows would have to have matching column names and types. Here is how you would manually create a
The bigger question I see here though is why are you do it this way? It seems like you could at least limit your query to only give you the first row in each table (
SELECT TOP 1 * FROM table
). You might also be able to do the joining of the four entries at the database level as well. Something like this:
SELECT TOP 1 FieldA, FieldB FROM table1
SELECT TOP 1 FieldA, FieldB FROM table2
SELECT TOP 1 FieldA, FieldB FROM table3
SELECT TOP 1 FieldA, FieldB FROM table4
That would give you the top record from each table and join them together. The output would be four rows.
Obviously these last suggestions would be dependent on how your environment is set up, but if possible I would definitely recommend going this way.