Hi @Shahab a
You should ensure that the types are explicitly defined.
Make sure the BsQRequestPorductHeader
is properly typed and its type includes the Current
property with the required items.
Try
' Assuming BsQRequestPorductHeader is a BindingSource or similar object
If BsQRequestPorductHeader.Current IsNot Nothing Then
' Explicitly cast the items to the appropriate types
Dim requestPorductHeaderId As Byte = Convert.ToByte(BsQRequestPorductHeader.Current("RequestPorductHeaderId"))
Dim requestPorductHeaderNum As String = BsQRequestPorductHeader.Current("RequestPorductHeaderNum").ToString()
TxtRequestPorductHeaderId.Text = requestPorductHeaderId.ToString()
TxtRequestPorductHeaderNum.Text = requestPorductHeaderNum
Else
TxtRequestPorductHeaderId.Text = String.Empty
TxtRequestPorductHeaderNum.Text = String.Empty
End If
Catch ex As InvalidCastException
MessageBox.Show("Error converting data: " & ex.Message)
Catch ex As Exception
MessageBox.Show("An unexpected error occurred: " & ex.Message)
End Try
Best Regards.
Jiachen Li
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.