What's wrong with these 3 lines of code? (C#, oleDb, beginner's level)
Posted on 2005-04-07
I am trying to display all shirt descriptions where there is the word "red" in the desc.
Code compiled fine. There is something missing in this sequence that crashes app when I run:
oleDbDataAdapter1.SelectCommand.CommandText = "SELECT Item_No, Shirt_Desc FROM SHIRTS WHERE Shirt_Desc LIKE %red%";
First I filled out the Select Command then I clear the dsShirt dataset. Finally, I assume that when the adapter's Fill is executed, the select command is automatically carried out. I must be wrong because it doesn't work as intended.