I have an excel sheet that has several headers. One of the header is Param2. The variable assigned to Param2 is strParam2 in my code. This is how strParam2 is declared in my code
String strParam2 = xlRange.Cells[row, 7].Value;
My code ideally reads the cells in the excel sheets and executes a set of actions. I have given a value of 2 in a cell under Param2 in my excel sheet. In order to convert it to string, I used the line
System.Int32.TryParse(strParam2.ToString(), out iDetailLevel);
However, I am getting an error "Cannot implicitly convert double to string" I tried this line too, but however I get an error again.
System.Double.TryParse(strParam2.ToString(), out iDetailLevel);
What is the problem here? Have anybody experienced a similar thing before?
iDetailLevel?implicitly convertit to a string via the=. You need to check the value of the cell and convert accordingly