I'm using VS2010 C#4.0
it states that cannot implicitly convert from string to boolCode:if (resultTable.Rows[i]["RISKADDRESS"].ToString().EndsWith(",") ? riskAddress = resultTable.Rows[i]["RISKADDRESS"].ToString().Substring(0, resultTable.Rows[i]["RISKADDRESS"].ToString().Length - 1) : riskAddress = resultTable.Rows[i]["RISKADDRESS"].ToString());
If I enter the above long hand i.e. with a full if else statement I receive no errors.
If I take the first partand wrap it in a Convert.ToBoolean or prefix with (Boolean), I still receive the error.Code:resultTable.Rows[i]["RISKADDRESS"].ToString().EndsWith(",")
The inline condition EndsWith needed to be ',' as opposed to ","


Reply With Quote