I'm trying to do something very simple, at least I thought it was until I spent the last couple days trying to figure out why it is not working. I would like to email the value that is being changed on RowUpdate of my Gridview. I'm using this code and get the error below:
Protected Sub GridView2_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView2.RowUpdating
Dim message As New MailMessage("username@company.com", "john_doe@compay.com", "Subject", e.Keys.Values)
Dim emailClient As New SmtpClient("smtpserver")
emailClient.Send(message)
End Sub
End
Class
Server Error in '/WebSite29' Application.
Unable to cast object of type 'OrderedDictionaryKeyValueCollection' to type 'System.String'.
Protected Sub GridView2_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView2.RowUpdating
Dim message As New MailMessage("username@company.com", "john_doe@compay.com", "Subject", e.Keys.Values)
Dim emailClient As New SmtpClient("smtpserver")
emailClient.Send(message)
End Sub
End
Class
Server Error in '/WebSite29' Application.
Unable to cast object of type 'OrderedDictionaryKeyValueCollection' to type 'System.String'.