Private Sub ShowData_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles ShowData.UpdateCommandDim tem(3) As String
tem(0) = CType(e.Item.Cells(1).Controls(0), TextBox).Text'//这里会说数据类型不能转换,这是为什么?
.....
.....
.....
End Sub

解决方案 »

  1.   

    说明e.Item.Cells(1).Controls(0), TextBox类型不一致
      

  2.   

    那我应该怎么转啊?我知道这个错误是要说明它和TEXTBOX类型不一致!重要的是解决方法!
      

  3.   

    tem(0) = (CType(e.Item.Cells(1).Controls(0), TextBox)).Text
      

  4.   

    强制类型转换(TextBox)e.Item.Cells(1).Controls(0), TextBox
      

  5.   

    e.Item.Cells(1)这里面的数字是根据什么定的啊?我的DATAGRID上面有 更新\编译\取消\删除,我那个程序不能写1,要写2,这是为什么?
      

  6.   

    哥哥~那就是我写错了,应该是DataGrid!
      

  7.   

    Dim ids1 As Integer
    ids1 = CType(e.Item.Cells(9).Controls(0), TextBox).Text