Reputation: 21
Trying to set my labels text to = the value of a specific row & columns value. I prefer to use Option Strict On but its disallowing the late binding. Ideas?
Private Sub BuildText(ByVal dtData As DataTable)
Try
lblVendor.Text = CType(CStr(dtData.Rows(0)("Vendor").value), String)
Catch ex As Exception
End Try
End Sub
Upvotes: 0
Views: 285
Reputation: 6859
To get the value you can use Field(Of T)
lblVendor.Text = dtData.Rows(0).Field(Of String)("Vendor")
DataRowExtensions.Field(Of T) Method (DataRow, String)
To use this you'll need to add a reference to System.Data.DataSetExtensions
Upvotes: 0