c# program closes on Win Xp but works fine on vista and Win7
<p>I Have a little problem. Like you read in the title my program closes on xp but works fine on vista and 7.</p>

<p>It happens only when I click in a listbox, there are no libraries in use.<br>
the only thing it does is to check in the database if there is a picture for a giving feature.<br>
if yes-> set it to the picture box, else use a standard picture.<br>
You will see that I Log the database problems, but these are empty, so or it doesn't write them or it never gets there</p>

<p>Any help is more then welcome</p>

<p>Code see here:</p>

<pre><code>    //form
    private void listViewFeatures_SelectedIndexChanged_1(object sender, EventArgs e)
    {
         this.pictureBoxEquip.Click -= pictureBoxEquip_Click;
         this.pictureBoxCar.Click -= pictureBoxCar_Click;
         this.pictureBoxEquip.DoubleClick -= this.OpenNewBigPhoto;
         this.pictureBoxCar.DoubleClick -= this.OpenNewBigPhoto;

        //check if pictures exists
        ListView.SelectedListViewItemCollection features = listViewFeatures.SelectedItems;
        string featureName = "";

        featureName = features[0].SubItems[1].Text.ToString();           

        BL_AddReport addReport = new BL_AddReport(this.databaseConnectionString);
        string carPic = addReport.GetCarPic(featureName);
        string equipPic = addReport.GetEquipmentPic(featureName);


        //yes -&gt; show
        if (carPic != null &amp;&amp; !carPic.Equals(""))
        {
            this.pictureBoxCar.Image = Image.FromFile(carPic);
            this.pictureBoxCar.DoubleClick += this.OpenNewBigPhoto;
        }
        //no -&gt; show defauld and add click event to add pictures
        else
        {
            this.pictureBoxCar.Click += pictureBoxCar_Click;
            pictureBoxCar.Image =   Volvo2.Properties.Resources.noImage;
        }            
    }

    //BL_addReport

    private IO_Database db;

    public BL_AddReport(string ConnectionString)
    {
        db = new IO_Database(ConnectionString);
    }
    public string GetCarPic(string feature)
    {
        return db.GetFeaturePhotoUrl(feature);
    }        

    //IO_Database

    private string connString;
    public IO_Database(string connString)
    {
        this.connString = connString;
    }

    public string GetFeaturePhotoUrl(string feature)
    {
        try
        {
            string url ="";
            using (SqlConnection conn = new SqlConnection(connString))
            {
                SqlCommand cmd = new SqlCommand("SELECT Photos.URL FROM Feature INNER JOIN Photos ON Feature.FeatureId = Photos.FeatureID WHERE (Feature.name = @feature AND Car='0')", conn);
                cmd.Parameters.Add("feature", SqlDbType.VarChar).Value = feature;
                conn.Open();
                using (SqlDataReader reader = cmd.ExecuteReader())
                {
                    while(reader.Read())
                    {
                        url = reader["URL"].ToString();
                    }
                    return url;
                }
            }
        }
        catch (DataException de)
        {
            //log the excepction
            this.log(ex);
            return null;
        }
        catch (Exception ex)
        {
            //log the excepction
            this.log(ex);
            return null;
        }
    }
</code></pre>
