how to read previous row value in Microsoft.Office.Interop.Excel and write with StringWriter C# Window application
<p>Top<br>
Aer2345 V-shape Cotton  Spring Wear 45
…<br>
…<br>
Jacket<br>
MEU874  ValleyGirl cotton jacket    Winter Wear 35
………         </p>

<p>I need to read and write each column of each row to a file. So when I use the for loop depending on from specific position to specific position, there is no problem. But I want to do automatically whenever the file is changed. So I wrote like:</p>

<pre><code>if (price == String.Empty &amp;&amp; itemCode != String.Empty)
    {                        

               cat = itemCode;
               GetCategory(cat);
    }                        

else
    {                       

            destinationCSV.WriteCSV("\"" + ProductName + "\"");


              destinationCSV.WriteCSV(",\"" + itemCode + "\"");


              destinationCSV.WriteCSV(",\"" + description + "\"");

    string catval = GetCategory(cat);
        destCSV.WriteCSV("," + catval);

    }   

protected string GetCategory(string category)
    {
            string catValue = category;
            return catValue;
        }
</code></pre>

<p>But I cannot get the previous row value when it starts to read the current row. </p>
