邀请(江雨,思归,孟子E章等高手前来),关于datagrid 与“新”数据集的问题。十分急!
我要在一个页面中把选取中(在datagrid中)的所有记录,当点击一个按钮时,添加到一个新建的public数据集中,然后在另外一个页面中的datagrid中绑定这个新的数据集,请问有什么好办法,我的方法有错:如下
public passds as new dataset()
Private Sub edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles edit.Click
Dim item As DataGridItem
passds.Tables.Add("editselected")
Dim newrow As DataRow
For Each item In mydatagrid.Items
Dim check As New System.Web.UI.HtmlControls.HtmlInputCheckBox()
check = item.FindControl("Checkselect")
If check.Checked = True Then
newrow = item.DataItem()
passds.Tables("editselected").Rows.Add(newrow)
passds.Tables("editselected").AcceptChanges()
passds.AcceptChanges()
End If
Next
mydatagrid.DataSource = passds.Tables("editselected").DefaultView
mydatagrid.DataBind()
End Sub
说passds.Tables("editselected").Rows.Add(newrow) row值不能为空。why????