Hello,
Firstly, i am not at my computer atm so i will not be able to show you my code (i will post it later).
I am creating a program for my dad which is sort of like a stock control program.
I have a form with two comboboxes and a listview. The first combobox binds to a SQL table called catagories which has two columns, CategoryID and CategoryDesc (Ex. 1,Tshirts). I can get these to populate correctly into the combobox, ValueMember = CategoryID & DisplayMamber = CategoryDesc. With this the selectedValue = CategoryID when the user selects it.
Now my issue is the second combobox. What i need to do is list in this combobx the products that match the categoryID (foreign key to another table called products). I have a WHERE query setup (basically, Find all products WHERE combobox1.selectedvalue = @categoryID.
Sounds simple enough and i thought it was, but for some strange reason i can get the displayMember to show the product description but the valuemember is null, therefore when selecting a product to populate the listview i get an SQL exception stating that @CategoryID = no data to read. This is due to the fact that the combobox2.selectedvalue = null.
I know this seems all over the place so i am willing to write a step by step process with the code (when i get home) if requested, as i am only after the help, if the questions no good the answer won't be any better ;)
Thanks in advance for the time spent on my query