Hi, I'm working on a program and keep getting the error "conversion from string to integer is not valid" for one variable and "conversion from string to type double is not valid." I'm fairly new at vb.net and I thought if you converted it you'd be okay. However every time I hit my "Save" button I get these errors. Can anyone help please? Thanks! The errors occur on the last 2 items in the declarations area at about line 11 or 12.
Public Class CollectionForm
Private Sub btnSaveData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveData.Click
'Declare variables to hold the input data, get the input data
Dim strRand As String = lblHomeID.Text
Dim strDate As String = CStr((CDate((Me.datDate.Text))))
Dim strCountystate As String = Me.cboCountyState.Text
Dim strRace As String = Me.cboRace.Text
Dim intNumberInHousehold As Integer = CInt(Me.txtNumHousehold.Text)
Dim dblYearlyIncome As Double = CDbl(Me.txtYearlyIncome.Text)
'Save the data to a txt file
Dim SurveyFile As System.IO.StreamWriter
Dim strFileName As String = "employees2.txt"
'Open the output file as append
SurveyFile = System.IO.File.AppendText(strFileName)
'Format the data with commas to separate fields
SurveyFile.Write(strRand)
SurveyFile.Write(",")
SurveyFile.Write(strDate)
SurveyFile.Write(",")
SurveyFile.Write(strCountyState)
SurveyFile.Write(",")
SurveyFile.Write(strRace)
SurveyFile.Write(",")
SurveyFile.Write(intNumberInHousehold)
SurveyFile.Write(",")
SurveyFile.WriteLine(dblYearlyIncome)
'Close the file
SurveyFile.Close()
'Validate the inputsyou
'Declare variables
Dim intHousehold As Integer
Dim dblIncome As Double
Dim blnValidated As Boolean
'Call the Validate_Inputs procedure
Validate_Inputs(intHousehold, dblIncome, blnValidated)
End Sub