Are you expecting a single result? If so, use First
, or Single
, or FirstOrDefault
to obtain a single Inventory
item (which of these options is most appropriate will depend on your situation). However, you will then have an Inventory
item, an Inventory.ToString()
may well not give you what you want either.
What are you trying to display from the inventory? Its name? Its description? Perhaps a combination? You should think about that very carefully - once you've decided what you're actually trying to achieve, writing the code for it is likely to be quite simple.
If your query could return multiple results, you've got even more to think about. Does it even make sense to have a single textbox? Perhaps you should be populating a table of some kind?