How to use ado.net reader?
How can i read only one record, when i want all records its fine but when i need a specific record with @id, my while loop jums out ?  

  [HttpGet]
    public ActionResult DeleteArticle(int ProductID)
    {
        int id = ProductID;

        if (ModelState.IsValid)
        {
               string connStr = ConfigurationManager.ConnectionStrings["AdminServices"].ConnectionString;
                using (SqlConnection connection = new SqlConnection(connStr))
                {
                    connection.Open();

                   //delete from database
                    using (SqlCommand command = new SqlCommand("DELETE FROM MyTable  WHERE id = @id", connection))
                    {
                        command.Parameters.AddWithValue("@id", id);
                        command.ExecuteNonQuery();
                    }

                     //read imagePathe from Database from database
                    using (SqlCommand command = new SqlCommand("SELECT * FROM MyTable WHERE id = @id", connection))
                    {

                        command.Parameters.Add("@id", System.Data.SqlDbType.Int).Value = id;
                        SqlDataReader reader = command.ExecuteReader();
                        while (reader.Read()) // --> here it skips while loop ????
                        {

                            string ImagePath = (string)reader["DbImagePath"];

                        }

                    }

                }
            }
            return RedirectToAction("Index", "Admin");
        }
How to use ado.net reader?
===

How can i read only one record, when i want all records its fine but when i need a specific record with @id, my while loop jums out ?  

  [HttpGet]
    public ActionResult DeleteArticle(int ProductID)
    {
        int id = ProductID;

        if (ModelState.IsValid)
        {
               string connStr = ConfigurationManager.ConnectionStrings["AdminServices"].ConnectionString;
                using (SqlConnection connection = new SqlConnection(connStr))
                {
                    connection.Open();

                   //delete from database
                    using (SqlCommand command = new SqlCommand("DELETE FROM MyTable  WHERE id = @id", connection))
                    {
                        command.Parameters.AddWithValue("@id", id);
                        command.ExecuteNonQuery();
                    }

                     //read imagePathe from Database from database
                    using (SqlCommand command = new SqlCommand("SELECT * FROM MyTable WHERE id = @id", connection))
                    {

                        command.Parameters.Add("@id", System.Data.SqlDbType.Int).Value = id;
                        SqlDataReader reader = command.ExecuteReader();
                        while (reader.Read()) // --> here it skips while loop ????
                        {

                            string ImagePath = (string)reader["DbImagePath"];

                        }

                    }

                }
            }
            return RedirectToAction("Index", "Admin");
        }