R
rbutch
Guys if anyone has an answer to this - i'd appreciate some assistance.
the problem is not building the dataset within String Builder - so i can render it as HTML in the email msg body.
the problem is - the dataset can change and return more or less columns than i have here and my DataRows, Im specifing
certain Indexes.
so, one time the dataset will have say, 5 rows in it and the next time it may have say 12. i'm about at the edge of my expertise right now, so any code examples from an expert would be appreciated - other wise the only thing i can think of is to
build separate Stringbuilder Components and pass a number to them that corresponds with the number of columns retrieved.
i've only included enough of the snippets of code in the procedure - to give clarity. i can send all if need be, but the real problem is in the aRow.Item("index")
thanks again for any help.
rik
Public ds As DataSet
Dim oMailMsg As MailMessage = New MailMessage
Dim sb As New StringBuilder
oMailMsg.BodyFormat = MailFormat.Html
sb.Append("<p><img SRC=C:\SelectLogo.gif></p><br>")
For Each aRow In ds.Tables(0).Rows
sb.Append("<table border=1 cellspacing=3><tr><td>" + aRow.Item(0) + "</td>" + "<td>" + aRow.Item(1) + "</td></tr></table>")
Next
oMailMsg.Body = sb.ToString
SmtpMail.Send(oMailMsg)
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
the problem is not building the dataset within String Builder - so i can render it as HTML in the email msg body.
the problem is - the dataset can change and return more or less columns than i have here and my DataRows, Im specifing
certain Indexes.
so, one time the dataset will have say, 5 rows in it and the next time it may have say 12. i'm about at the edge of my expertise right now, so any code examples from an expert would be appreciated - other wise the only thing i can think of is to
build separate Stringbuilder Components and pass a number to them that corresponds with the number of columns retrieved.
i've only included enough of the snippets of code in the procedure - to give clarity. i can send all if need be, but the real problem is in the aRow.Item("index")
thanks again for any help.
rik
Public ds As DataSet
Dim oMailMsg As MailMessage = New MailMessage
Dim sb As New StringBuilder
oMailMsg.BodyFormat = MailFormat.Html
sb.Append("<p><img SRC=C:\SelectLogo.gif></p><br>")
For Each aRow In ds.Tables(0).Rows
sb.Append("<table border=1 cellspacing=3><tr><td>" + aRow.Item(0) + "</td>" + "<td>" + aRow.Item(1) + "</td></tr></table>")
Next
oMailMsg.Body = sb.ToString
SmtpMail.Send(oMailMsg)
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...