Why is this giving me an error of end of stmt expected

Posted on 2009-05-15
Last Modified: 2013-12-26
Dim Fullname.Text as string() = cstr(Request.Form("Fullname"))  
C:\inetpub\wwwbonney\index_files\feedbackconfirm.aspx(15) : error BC30205: End of statement expected.

Dim Fullname.Text as string() = cstr(Request.Form("Fullname"))  

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"


<%@ Page Language="vb" aspcompat=true debug=true Explicit="True" %>

<%@ Import Namespace="ADODB" %>

<%@ Import Namespace="System.Data" %>

<%@ Import Namespace="System.Data.OleDb" %>

<%@ Import Namespace="System.Web.Mail" %>

<%@ Import Namespace="System.Text" %>

<%@ Import Namespace="System.IO" %>

<%@ Import Namespace="System.Reflection" %>

<%@ Import Namespace="DimpleSoftwares.ASPNET.Components" %>

<script language="vb" runat="server">

Dim Fullname.Text as string() = cstr(Request.Form("Fullname"))  

Dim Address.Text as string() =  cstr(Request.Form("Address")) 

Dim City.Text as string() = cstr(Request.Form("City")) 

Dim States.Text as string() = cstr(Request.Form("States")) 

Dim Country.Text as string() = cstr(Request.Form("Country")) 

Dim Postcode.Text as string() = cstr(Request.Form("Postcode")) 

Dim Phone.Text as string() = cstr(Request.Form("Phone")) 

Dim selection2.Text as string()  

Dim selection3.Text as string()  

Dim selection4 as string()

Dim selection5 as string() 

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)




		   If ValidEmail then

		     selection2.Text = "Email has been successfully sent!"

                     selection3.Text = "And your details sent to"





		    selection2.Text = "Feedback is alsmost complete!"

                    selection3.Text = "However your email is invalid!"

                    selection4.Text = "Please click the back button and correct this before resubmitting."

                    selection5.Text = "  " 

		   end if		

    End Sub


        Private Function ValidEmail() As Boolean

		Dim e   =  new EmailAddressValidator()


			e.DnsServer = ""

			e.SmtpFromEmail = ""

			e.SmtpFromDomain = ""

			e.UseMXCach = true						


			if e.Validate(cstr(Request.Form("Email")))			

			Return True

			end if			

	End Function


	Private Sub SendMail()

	dim Mail	

	Mail = Server.CreateObject("CDO.Message")

		dim objMessage,objConfig,Flds,MyBody

 		objMessage = Server.CreateObject("cdo.message")

        objConfig = Server.CreateObject("cdo.configuration")

' Setting the SMTP Server

        Flds = objConfig.Fields

        Flds.Item("") = 2

        Flds.Item("") = ""


        objMessage.Configuration = objConfig

        objMessage.To = ""

        objMessage.From = cstr(Request.Form("Email"))

        objMessage.Subject = "From Bonney Place Website"

        MyBody = "Name :" & cstr(Request.Form("Fullname")) &  vbCrLf 

		MyBody = MyBody &  vbCrLf & vbCrLf 

        MyBody = MyBody &  "Phone:" & cstr(Request.Form("Phone")) 

		MyBody = MyBody &  vbCrLf & vbCrLf 

        MyBody = MyBody & "Address:" & cstr(Request.Form("Address")) & "," & cstr(Request.Form("city")) & "," & cstr(Request.Form("States")) & "," & cstr(Request.Form("Country")) & " " & cstr(Request.Form("Postcode")) 

        MyBody = MyBody &  vbCrLf & vbCrLf 

		MyBody = MyBody &  "E-mail:" & cstr(Request.Form("Email")) 

		MyBody = MyBody &  vbCrLf & vbCrLf 


		objMessage.TextBody = MyBody    



        objMessage = nothing

        objConfig = nothing	



    End Sub



Open in new window

Question by:halinab
LVL 12

Expert Comment

Comment Utility
if you comment out that line do you get teh same error message on the next line Dim Address.Text as string() =  cstr(Request.Form("Address"))
Just a thought, if you do then it suggest that it doesn't like the way you are DIMing the statement or something???

LVL 75

Accepted Solution

Anthony Perkins earned 500 total points
Comment Utility
Should it not be:
Dim Fullname As string = CStr(Request.Form("Fullname"))

Author Closing Comment

Comment Utility
yes perfect - worked fine

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now