关于使用数据窗体向导遇到的问题
我在窗体代码编辑器里定义的如下两个过程Public Class Form1
Inherits System.Windows.Forms.Form
Private Function fill_students() As DataSet1
Dim ds As New DataSet1
Me.SqlConnection1.Open()
Try
Me.SqlDataAdapter1.Fill(ds, "students")
Catch excep_fill As System.Exception
MsgBox("程序出錯,錯誤原因是:" & excep_fill.Message, MsgBoxStyle.Exclamation)
End Try
Me.SqlConnection1.Close()
Return ds
End Function
Private Sub update_students(ByVal ds As DataSet1)
Me.SqlConnection1.Open()
Dim row_update As DataSet
Dim row_insert As DataSet
Dim row_delete As DataSet
Dim row_unchange As DataSet
row_update = ds.GetChanges(DataRowState.Modified)
row_insert = ds.GetChanges(DataRowState.Added)
row_delete = ds.GetChanges(DataRowState.Detached)
row_unchange = ds.GetChanges(DataRowState.Unchanged)
Try
If ds.HasChanges(DataRowState.Added) Then
Me.SqlDataAdapter1.Update(row_insert)
End If
If ds.HasChanges(DataRowState.Modified) Then
Me.SqlDataAdapter1.Update(row_update)
End If
If ds.HasChanges(DataRowState.Deleted) Then
Me.SqlDataAdapter1.Update(row_delete)
End If
If ds.HasChanges(DataRowState.Unchanged) Then
Me.SqlDataAdapter1.Update(row_unchange)
End If
Catch excep_update As System.Exception
MsgBox("程序出錯,錯誤原因是:" & excep_update.Message, MsgBoxStyle.Exclamation)
MsgBox(excep_update.Source)
End Try
Me.SqlConnection1.Close()
End Sub
但是在数据窗体向导的选择加载和更新数据的方法那个步骤下找不到这两个过程请问是怎么回事??