Conversion from string to type double is not valid


E

Ed Dror

Hi there,

I'm using asp.net 2.0 and I wrote

Public Function SendAlert() As Integer

Try

Dim nwln As String = System.Environment.NewLine
Dim message As MailMessage = New MailMessage()

message.From = New MailAddress("(e-mail address removed)")
message.To.Add(New MailAddress("(e-mail address removed)"))


message.Subject = "eCatalog Alert"
message.Body = "On " + txtDate.Text + " " + txtCrtdUser.Text + "
added a new supplier in the Vendor name" + nwln + _
"The following supplier was added " + nwln + _
+nwln + _
"Vendor_Name: " + txtVendorName.Text + nwln + _
"Address1: " + txtAddress1.Text + nwln + _
"Address2: " + txtAddress2.Text + nwln + _
"City: " + txtCity.Text + nwln + _
"State: " + txtState.Text + nwln + _
"Zip: " + txtZip.Text + nwln + _
"Phone: " + txtPhone.Text + nwln + _
"Fax: " + txtFax.Text + nwln + _
"Email: " + txtEmail.Text + nwln + _
"URL: " + txtURL.Text + nwln

Dim mailClient As New System.Net.Mail.SmtpClient()
Dim basicAuthenticationInfo As New
System.Net.NetworkCredential("xxxxx", "xxxxx")

mailClient.Host = "mail.xxxxx.com"
mailClient.Port = "25"
mailClient.UseDefaultCredentials = False
mailClient.Credentials = basicAuthenticationInfo
mailClient.Send(message)

Catch ex As Exception
ErrorMessage.Text = ex.Message.ToString
Exit Try
End Try
End Function

Protected Sub btnVendor_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnVendor.Click
Try
Call SendAlert()
Catch ex As Exception
ErrorMessage.Text = ex.Message.ToString
End Try
End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load

txtCrtdUser.Text = User.Identity.Name
Dim dtNow As DateTime = DateTime.Now
txtDate.Text = dtNow.ToString

End Sub

Now when I'm click on Submit I'm getting error that says:

Conversion from string "On 4/8/2008 9:58:13 AM Ed Dror " to type 'Double'
is not valid.

It looks like it reffer to the txtCrtdUser.Text and txtDate.Text

How do I fix it ?

Thanks,
Ed Dror
 
Ad

Advertisements

Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top