Conversion from string to type double is not valid

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 [at] andrewlauren.com")
message.To.Add(New MailAddress("edd [at] 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
Ed Dror [ Di, 08 April 2008 19:07 ] [ ID #1937805 ]

Re: Conversion from string to type double is not valid

Try using ampersand for the string concatenation, instead of plus.
joetcochran [ Di, 08 April 2008 19:59 ] [ ID #1937810 ]

Re: Conversion from string to type double is not valid

Joe,

You are abselutly currect.

Thanks,
Ed Dror


"joetcochran" <joetcochran [at] gmail.com> wrote in message
news:55226718-2a3c-4d56-b1f6-893f102d0a3c [at] t54g2000hsg.google groups.com...
> Try using ampersand for the string concatenation, instead of plus.
Ed Dror [ Di, 08 April 2008 20:36 ] [ ID #1937815 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » Conversion from string to type double is not valid

Vorheriges Thema: Making a WPF/NET 3.x Project
Nächstes Thema: AJAX and IsPostBack