EditCard.IDCard - int
|
int currentRowIndex = DataGridView1.CurrentRow.Index; EditCard.IDCard = (int)DataGridView1[currentRowIndex, 0].Value; |
выдает:
InvalidCastException was unhandled!
Specified cast is not valid.
каким тогда образом можно данные из БД присвоить переменной или свойству класса?
подскажите, плз.