Question: trying to return data using `OracleDataReader`, getting 

```
"Object reference not set to an instance of an object " at the line "odr = 
ocmd.ExecuteReader();",

```

Can anyone suggest what I am missing / done wrong?

thanks

T

```
           OracleConnection cn = null;
            OracleDataReader odr = null;
            OracleCommand ocmd = null;

            String con1 = System.Configuration.ConfigurationManager.ConnectionStrings["HousingDBConnectionString"].ConnectionString;
            cn = new OracleConnection(con1);
            cn.Open();

            string mysql = "SELECT stuff from tables";
            OracleCommand cmd = new OracleCommand(mysql, cn);
            odr = ocmd.ExecuteReader();
            Label2.Text = "connection success";

            ListBox1.Items.Clear();
            while (odr.Read()) 
            {
                ListBox1.Items.Add(odr["TCY_CORRESPOND_NAME"].ToString());
            }

```

Answer: 
You declared ocmd as null, but then you created another OracleCommand object as cmd. ocmd was never instantiated.

This part is wrong:

```
OracleCommand cmd = new OracleCommand(mysql, cn); 
odr = ocmd.ExecuteReader(); 

```

It should be:

```
OracleCommand cmd = new OracleCommand(mysql, cn); 
odr = cmd.ExecuteReader(); 

```
```
OracleCommand cmd = new OracleCommand(mysql, cn);

```

should be

```
OracleCommand ocmd = new OracleCommand(mysql, cn);   

```