I am writing a program (for personal use) that stores card names into a database. I want to implement a way to see if a name already exists and if it does it will go in a "Do\_have\_in\_db\_listbox" else it will go in a "do\_not\_have\_list\_box". This is my original method for doing so:

```
 while (retrieve.Read())
        {
            if(retrieve["Card"] != DBNull.Value)
            {
                listBox_haveInDB.Items.Add(word_for_query);
            }
            else if (retrieve["Card"] == DBNull.Value)
            {
                listBox_notINDb.Items.Add(word_for_query);
            }
        }

```

I've tried this without the While loop, I've tried variations of if, else, else if and conditions. But for whatever reason the else statement NEVER executes no mater what the first condition is. I've been looking and trying to trouble shoot but the only thing that worked for me was an exception handler:
[![screenshot](https://i.stack.imgur.com/RQgGJ.png)](https://i.stack.imgur.com/RQgGJ.png)

```
retrieve.Read();
try
          {
              if(retrieve["Card"] != DBNull.Value)
              {
                  listBox_haveInDB.Items.Add(word_for_query);
              }
          }
          catch
          {
              listBox_notINDb.Items.Add(word_for_query);
          }

```

This is my way of getting around it. What am I doing wrong?