You're using the MsgBox
function wrong.
Look what parameters it accepts:
Public Function MsgBox( _
ByVal Prompt As Object, _
Optional ByVal Buttons As MsgBoxStyle = MsgBoxStyle.OKOnly, _
Optional ByVal Title As Object = Nothing _
) As MsgBoxResult
When you call MsgBox(item.ProductName, " ", item.UnitPrice.ToString)
you pass " "
for the Buttons
parameter, which should be of type MsgBoxStyle
(or at least the underlying type: Integer
, which VB.Net converts to MsgBoxStyle
implicitly if you use Option Strict Off
).
You're probably looking for something like:
MsgBox(String.Format("{0} {1}", item.ProductName, item.UnitPrice))
or
MsgBox(item.ProductName, MsgBoxStyle.OKOnly, item.UnitPrice)