Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27311

listbox posting "argument exception..."

$
0
0
This may seem like a simple or dum questions but in my list box, I want it to always display a couple messages. Under those, I want it to diplay results from a datasource. My code is:
Dim invquery = From inv In _MICROLAND_1_DataSet2.Inventory
Join orders In _MICROLAND_1_DataSet.Orders
On inv.itemID Equals orders.itemID
Select inv.itemID & " " & (inv.quantity - orders.quantity) & " " & inv.description

lstBox.Items.Add(CStr("Here are the items that are out of inventory or must be reordered."))
lstBox.Items.Add(CStr("The numbers shown give the minimum reorder quantity required."))
lstBox.Items.Add(" ")
lstBox.DataSource = invquery.ToList
lstBox.SelectedItem = Nothing
But the results I get are the datasource and it states my messages are "argument exception unhandled." How do I fix this and why is it claiming this?

Viewing all articles
Browse latest Browse all 27311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>