I try to convert programType from string to integer value
but it show me "Input string was not in a correct format." error..can anyone help to to solve this question?
Private Sub cmbProgram_SelectionChangeCommitted(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbProgram.SelectionChangeCommitted
'converting string to integer value'
Dim programType As Integer = Integer.Parse(cmbProgram.SelectedValue.ToString)
Dim sqlselect As String = "select ProgramCode from Program where ProgramType =" & programType
Dim dr As OleDbDataReader
conn.Open()
cmd = New OleDbCommand(sqlselect, conn)
dr = cmd.ExecuteReader
dr.Read()
Dim programCode As String = dr("ProgramCode")
txtProgramCode.Text = programCode
dr.Close()
conn.Close()
End Sub