Dim txtCom1 As TextBox = CType(Me.Datagrid2.FindControl("TextBox5"), TextBox).text Dim txtCom2 As TextBox = CType(Me.Datagrid2.FindControl("TextBox6"), TextBox).text