Skydiver, on 08 August 2012 - 11:43 AM, said:
contactsHandled = (string)dvData.Rows[0].Cells["scallshandled"];
and the code I had posted:
contactsHandled = (int) dvData.Rows[0].Cells["scallshandled"].Value;
1. I'm accessing the Value property of the DataGridViewCell. You are just accessing the DataGridViewCell.
2. I'm casting the value into integer since I'll be storing the value into contactsHandled which is an integer. You are casting the DataGridViewCell into a string and trying to store it into an integer.
When attempted with the changes it runs into this error:
there was an error - System.InvalidCastException: Specified cast is not valid.

New Topic/Question
Reply




MultiQuote



|