Below is a code displaying records from a view which is concatenating first and surname in textbox on the form called accoutnholder. But the code "txtAccountHolder.Text = myDataReader.Item("First_Name&" - " &Surname")tostring]" show the expression does not produce value. please i need ur help to continue
Private Sub txt_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtLoan_no.LostFocus
put = "SELECT * FROM Loan WHERE (Loan_no = @Loan_no)"
Dim mySqlDBConnection As New SqlConnection(ConnectionString)
Dim mySqlDBCommand As New SqlCommand(put, mySqlDBConnection)
mySqlDBCommand.Parameters.AddWithValue("@Loan_No", txtLoan_no.Text)
Using myDataReader As SqlDataReader = mySqlDBCommand.ExecuteReader
If myDataReader.Read() Then
txtAccountHolder.Text = myDataReader.Item("First_Name&" - " &Surname")tostring]
txtAccount_no.Text = myDataReader.Item("Account_no").ToString
msdDate_Applied.TextMaskFormat = myDataReader.Item("Date_Applied").ToDate
txtPrin_Amount.Text = myDataReader.Item("Prin_Amount").todouble
txtAccount_Name.Text = myDataReader.Item("Account_Name").ToString
MessageBox.Show("Record Doesn't exit, add as new record")
End If
End Using
Catch ex As SqlException
MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)
Catch err As System.Exception
MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub

txtAccountHolder.Text = myDataReader.Item("First_Name&" - " &Surname")tostring]

chage it with :

txtAccount_Name.Text = myDataReader.Item("First_Name").ToString & "-" & myDataReader.Item("Surname").ToString
This question has already been answered. Start a new discussion instead.