r/visualbasic • u/FabulousFoodHoor • Nov 28 '21
How do I reference and concatenate database fields on a Windows form?
I need to display first name and last name concatenated. The database is connected as a data source. I created a label to display the concatenated result. This is what I have so far but I'm really just guessing.
Private Sub lblFNameLName_Click(sender As Object, e As EventArgs) Handles lblFNameLName.Click
' Dim FirstLast As String
' Sql = "SELECT FirstName || " " || LastName FROM Customer"
' lblName.txt =
End Sub
2
Upvotes
View all comments
Show parent comment
1
u/FabulousFoodHoor Nov 28 '21
There's nothing else to the code on the form. This click event was the only thing.
I did look at the Microsoft reference but it doesn't go over simply referencing a field. That tutorial also doesn't go over that. It's a tutorial on connecting to a data source and adding a new row.
I feel like this should be something simple to find. Hopefully, someone can respond to my post with some insight.