Conversion from string to type double is not valid

Conversion from string to type double is not valid

am 08.04.2008 19:07:48 von 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("edd@andrewlauren.com")
message.To.Add(New MailAddress("edd@andrewlauren.com"))


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

Re: Conversion from string to type double is not valid

am 08.04.2008 19:59:00 von joetcochran

Try using ampersand for the string concatenation, instead of plus.

Re: Conversion from string to type double is not valid

am 08.04.2008 20:36:59 von Ed Dror

Joe,

You are abselutly currect.

Thanks,
Ed Dror


"joetcochran" wrote in message
news:55226718-2a3c-4d56-b1f6-893f102d0a3c@t54g2000hsg.google groups.com...
> Try using ampersand for the string concatenation, instead of plus.