samedi 30 mai 2015

Not going into if statement if object is found

I'm trying to display a result in a textbox if a book is found. The thing is that the book is stored and is in a list, but the code won't execute that the book is found. Instead it's displaying that the book is not found. Can anyone help out pls? Thanks

 Resource found = new Library().binarySearch(txtTitle.Text);

        if(found != null)
        {
           txtResult.Text = found.ToString();
        }
        else
        {
            txtResult.Text = "Item not found";
        }

Aucun commentaire:

Enregistrer un commentaire