Be seen. Boost your question’s priority for more expert views and faster solutions
Private Sub list1_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles list1.Validated
Try
Dim v_titlecode As String = "test"
Dim a As Object
sel_stat2 = "SELECT title_code FROM ch_account_titles WHERE title_desc = ' " & list1.SelectedItem & " '"
Conn.Open()
Dim sel2 As New SqlCommand(sel_stat2, Conn)
acctitle.Text = sel2.ExecuteScalar()
Conn.Close()
'MsgBox("list validated")
catch ex as Exception
messagebox.show ex.tostring()
end try
End Sub
dim _retVal as object = cmd.ExecuteScalar()
If (_retVal Is Nothing) Then
'Null
Else
acctitle.Text = _retVal.ToString()
End If
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
sel_stat2 = "SELECT title_code FROM ch_account_titles WHERE title_desc = '" & list1.SelectedItem & "'"