Creating and returning copy of object in class method
<p>I have a class called movie. Movie has a movieYear string property and movieYearInt int property. I want a class method where I can send the movie object and get an object back that has taken the movieYear string property and copied its value to movieYearInt. Later on I will be converting more properties of the object.</p>

<p>this is the movie class</p>

<pre><code> public class movie
{
    public string movieName { get; set; }
    public string movieYear { get; set; }
    public int movieYearInt { get; set; }

    public movie convertFilm(movie m)
    {
        m.movieYearInt = int.Parse(m.movieYear);
        return m;
    }
}
</code></pre>

<p>and this is how I thought of retrieving the object in my form</p>

<pre><code>movie m = new movie();
m.movieYear = cmbMovieYear.ToString();  
movie newMovie = m.convertFilm(m);
</code></pre>

<p>The error i get is: input string was not in a correct format
what am I doing wrong?</p>

<p>edit-
This is the movieYear combobox</p>

<pre><code>List&lt;int&gt; allYears = new List&lt;int&gt;();
allYears.AddRange(Enumerable.Range(1900, 113));
cmbMovieYear.DataSource = allYears;
</code></pre>

<p>edit-</p>

<pre><code>m.movieYear = cmbMovieYear.SelectedItem.ToString();
</code></pre>

<p>This was the solution.</p>
