【正文】
= (palydate) = CurrentPosition + 1 amp。 / amp。 RecordCount End If End Sub Private Sub Form4_Load(ByVal sender As , ByVal e As ) Handles () (DataSet11) ShowPosition() End Sub Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles If (DataSet11, Movies).Position 0 Then (DataSet11, Movies).Position = 1 ShowPosition() Else (已到達(dá)首記錄!, 提示信息) End If End Sub Private Sub Button2_Click(ByVal sender As , ByVal e As ) Handles If (DataSet11, Movies).Position RecordCount 1 Then (DataSet11, Movies).Position += 1 ShowPosition() Else (已到達(dá)尾記錄!, 提示信息) End If End Sub Private Sub Button4_Click(ByVal sender As , ByVal e As ) Handles (DataSet11, Movies).Position = RecordCount 1 ShowPosition() End Sub Private Sub Button5_Click(ByVal sender As , ByVal e As ) Handles 39。添加數(shù)據(jù) Dim j As Integer Dim flag As Boolean = True For j = 0 To i If = CStr(idnum(j)) Then flag = False (ID地址有沖突!, 提示) End If Next If flag = True Then Dim MyNewData As DataRow MyNewData = Try With MyNewData .BeginEdit() If Then .Item(movie_id) = Else (編號不能為空) Return End If .Item(movie_name) = .Item(actor) = .Item(actress) = .Item(producer) = .Item(palydate) = .EndEdit() End With Catch ex As Exception () Return End Try (MyNewData) Try Dim i As Integer = (DataSet11, Movies) () (i amp。 條記錄添加成功!) Catch ex As Exception () End Try idnum(i) = i = i + 1 End If End Sub Private Sub Button6_Click(ByVal sender As , ByVal e As ) Handles 39。修改數(shù)據(jù) Dim j As Integer For j = 0 To i If = CStr(idnum(j)) Then (ID地址有沖突!, 提示) End If Next CurrentPosition = (DataSet11, Movies).Position movieRow = (CurrentPosition) Try With movieRow .BeginEdit() .Item(movie_id) = .Item(movie_name) = .Item(actor) = .Item(actress) = .Item(producer) = .Item(palydate) = .EndEdit() End With Catch ex As Exception () Return End Try Try Dim i As Integer = (DataSet11, Movies) () (i amp。 條記錄修改成功!) Catch ex As Exception () End Try End Sub Private Sub Button3_Click(ByVal sender As , ByVal e As ) Handles (DataSet11, Movies).Position = 0 ShowPosition() End Sub Private Sub Button7_Click(ByVal sender As , ByVal e As ) Handles 39。刪除數(shù)據(jù) CurrentPosition = (DataSet11, Movies).Position movieRow = (CurrentPosition) Dim n As Integer = (movie_id) Dim j As Integer = 0 For j = 0 To i If n = idnum(j) Then idnum(j) = 1 End If Next () Try Dim i As Integer = (DataSet11, Movies) () (i amp。 條記錄刪除成功!) Catch ex As Exception () End Try End Sub Private Sub Button8_Click(ByVal sender As , ByVal e As ) Handles Dim exitform As New Form7 If = Then () () () End If End Sub Private Sub Button9_Click(ByVal sender As , ByVal e As ) Handles Dim frm8 As New Form8 () () End SubEnd Class2.創(chuàng)建職工界面(1)創(chuàng)建模塊的功能 對職工數(shù)據(jù)的處理。如增加、刪除和更改(2)創(chuàng)建模塊的設(shè)計(jì)在工程中添加一個(gè)窗體,命名為“影庫系統(tǒng)”,用來作為影庫系統(tǒng)窗體。界面 的設(shè)計(jì)如下圖所示。(3)代碼編寫 Inherits Dim frm8 As New Form8Dim sqlAdapter As New SqlDataAdapter Dim movieRow As DataRow Dim RecordCount As Integer Dim i As Integer = 0 Dim idnum(2000) As Integer Dim CurrentPosition As Integer Sub ShowPosition() RecordCount = If RecordCount = 0 Then = 無記錄 Else CurrentPosition = (DataSet11, Workers).Position movieRow = (CurrentPosition) = (workerid) idnum(i) = i += 1 = (password) = (leibie) = CurrentPosition + 1 amp。 / amp。 RecordCount End If End SubPrivate Sub Form6_Load(ByVal sender As , ByVal e As ) Handles () (DataSet11) ShowPosition() End Sub Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles If (DataSet11, Workers).Position 0 Then (DataSet11, Workers).Position = 1 ShowPosition() Else (已到達(dá)首記錄!, 提示信息) End If End Sub Private Sub Button2_Click(ByVal sender As , ByVal e As ) Handles If (DataSet11, Workers).Position RecordCount 1 Then (DataSet11, Workers).Position += 1 ShowPosition() Else (已到達(dá)尾記錄!, 提示信息) End If End Sub Private Sub Button3_Click(ByVal sender As , ByVal e As ) Handles (DataSet11, Workers).Position = 0 ShowPosition() End Sub