int j=(int)(datagridview1[0,3].value)

解决方案 »

  1.   

    不行
    错误 1 “System.Windows.Forms.DataGridViewCell”并不包含“value”的定义
    string bb = dgvView.CurrentRow.Cells [0].Value.ToString(); 
    可以但返回的是字符串
      

  2.   

    奇怪了- -!
    我自己在程序里是这个样子写的:
    int a = (int)(datagridview1[0, datagridview1.CurrentCell.RowIndex].Value);因为我写程序的时候要写FOR语句
    所以也要获取单元格内的值
      

  3.   

    但为什么转成长整型还是不行 
    未处理的“System.InvalidCastException”类型的异常出现在 AccessDemo.exe 中。其他信息: 指定的转换无效。