⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form12.vb

📁 学生信息管理系统
💻 VB
字号:
Public Class Form12
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.ListBox1 = New System.Windows.Forms.ListBox
        Me.SuspendLayout()
        '
        'ListBox1
        '
        Me.ListBox1.ItemHeight = 12
        Me.ListBox1.Location = New System.Drawing.Point(56, 40)
        Me.ListBox1.Name = "ListBox1"
        Me.ListBox1.Size = New System.Drawing.Size(184, 172)
        Me.ListBox1.TabIndex = 0
        '
        'Form12
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(292, 273)
        Me.Controls.Add(Me.ListBox1)
        Me.Name = "Form12"
        Me.Text = "查询学生成绩总分"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub Form12_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim mark As Integer = 0
        ListBox1.Items.Clear()
        If Not Class1.ds.Tables("E") Is Nothing Then
            Class1.ds.Tables("E").Clear()
        End If
        Class1.ada.SelectCommand.CommandText = "select * from 考试成绩"
        Class1.ada.Fill(Class1.ds, "E")
        Class1.ada.SelectCommand.CommandText = "select distinct 学号 from 考试成绩"
        If Not Class1.ds.Tables("M") Is Nothing Then
            Class1.ds.Tables("M").Clear()
        End If
        Class1.ada.Fill(Class1.ds, "M")
        Dim i As Integer
        For i = 0 To Class1.ds.Tables("M").Rows.Count - 1
            Dim sno As String = Class1.ds.Tables("M").Rows(i).Item("学号")
            Class1.ada.SelectCommand.CommandText = "select 分数 from 考试成绩 where 学号='" & sno & "'"
            If Not Class1.ds.Tables("N") Is Nothing Then
                Class1.ds.Tables("N").Clear()
            End If
            Class1.ada.Fill(Class1.ds, "N")
            Dim j As Integer
            mark = 0
            For j = 0 To Class1.ds.Tables("N").Rows.Count - 1
                mark = mark + Class1.ds.Tables("N").Rows(j).Item("分数")
            Next
            ListBox1.Items.Add("学生" & " " & sno & " " & "的总分为:" & " " & mark)
            ListBox1.Items.Add("")
        Next
        Me.CenterToScreen()
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -