convert variable in asp.net

surmount

New Member
I wrote a piece of simple code that I dont to find what the problem.the code is:\[code\] var sortSecurities="SELECT * FROM securities"; int total=0; var value=""; foreach(var row in db.Query(sortSecurities)) { value=http://stackoverflow.com/questions/13748448/row.lastGate; total=Convert.ToInt32(value)*100;// here the problem with compilation.. db.Execute("INSERT INTO holding(IDgrossPortfolio,IDSecurity,totalHolding,units,buyGate) "+"VALUES (@0,@1,@2,@3,@4)",row.category,row.number,total,"100",row.lastGate); }\[/code\]what the problem with the convert?the error is:\[quote\] Exception Details: System.FormatException: Input string was not in a correct format.\[/quote\]
 
Back
Top