Now I have no idear what specific language this is in, but from the small code examples you've shown here, I'm guessing VB, it's been a while since I've touched that, but something like:
Code:
...
Dim sb As New StringBuilder
Dim rows As Integer
Dim colums As Integer
Dim i As Integer
Dim j As Integer
...
oMailMsg.BodyFormat = MailFormat.Html
rows = ds.Tables.Rows.Count
columns = ds.Tables.Columns.Count
sb.Append("<p><img SRC=C:\SelectLogo.gif></p><br>")
sb.Append("<table border=1>")
For i = 0 To rows
sb.Append("<tr>")
For j = 0 To columns
sb.Append("<td>" + ds.Tables(i).Item(j) + "</td>")
Next j
sb.Append("</tr>")
Next i
sb.Append("</table>")
might give you a hint on where I'm going with how you can access the items in a NxM table.