近日用asp.net 2003开发一个基于B/S模式的数据库管理系统,在使用Dataset时,发现下列一些问题:
1.添加修改删除都没有反应
2.查看上一条,下一条时,只能查看两项,其他的都看不到了。我自己编了一个查看的函数:
 Private Sub showcurrent(ByVal current As Integer)
        areaid.Text = Convert.ToString(dt.Rows(current).Item("areaID"))
        areaname.Text = Convert.ToString(dt.Rows(current).Item("name"))
        description.Text = Convert.ToString(dt.Rows(current).Item("description"))
    End Sub
然后插入的函数:
 Private Sub insert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles insert.Click
        Dim drow As DataRow
        drow = dt.NewRow
        drow.BeginEdit()
        drow("areaid") = areaid.Text
        drow("name") = areaname.Text
        drow("description") = description.Text
        drow.EndEdit()
        dt.Rows.Add(drow)
    End Sub
下一条的函数:
 Private Sub nextone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nextone.Click
        current = current + 1
        If current >= dt.Rows.Count Then
            current = dt.Rows.Count - 1
        End If
        If dt.Rows.Count > 0 Then
            showcurrent(current)
        End If
    End Sub
最后还有个提交函数:
 Private Sub upload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles upload.Click        Try
            SqlDataAdapter1.Update(DataSet1.GetChanges.Tables("area_info"))
        Catch ex As Exception
            dt.RejectChanges()
        End Try
    End Sub困惑之极,原来我在Delphi中就是这样使用的,那时完全正确,不过那时做的是单机版的。
恳请大虾指点,谢谢先