毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

学生成绩管理系统ER图+流程图+组织结构图 第3页

更新时间:2009-4-10:  来源:毕业论文
学生成绩管理系统
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myview As DataView
        myview = New DataView(DataSet31.chengji, "kemubianhao ='" & ComboBox1.Text & "'", "xuehao", DataViewRowState.CurrentRows)
        Dim rowindex As Integer = myview.Find(TextBox1.Text)
        If rowindex = -1 Then
            MsgBox("数据库中未找到与此纪录重复的数据,可以存入!")
            Dim str As String = "insert into chengji(xuehao, xingming, kemubianhao, kemufenshu, banjimingcheng) values (@xuehao, @xingming, @kemubianhao, @kemufenshu, @banjimingcheng)"
            Dim com As OleDbCommand = New OleDbCommand(str, mycon)
            com.Parameters.Add("@xuehao", OleDbType.VarChar).Value = TextBox1.Text
            com.Parameters.Add("@xingming", OleDbType.VarChar).Value = TextBox2.Text
            com.Parameters.Add("@kemubianhao", OleDbType.VarChar).Value = ComboBox1.Text
            com.Parameters.Add("@kemufenshu", OleDbType.VarChar).Value = TextBox3.Text
            com.Parameters.Add("@banjimingcheng", OleDbType.VarChar).Value = ComboBox2.Text
            mycon.Open()
            com.ExecuteNonQuery()
            mycon.Close()
            MessageBox.Show("信息已成功存入数据库", "恭喜", MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
            DataSet31.Clear()
            OleDbDataAdapter3.Fill(DataSet31)
        Else
            Beep()
            MsgBox("数据库中次纪录已存在,请重新输入!")
        End If
        TextBox1.Clear()
        TextBox2.Clear()
        TextBox3.Clear()
        ComboBox1.ResetText()
        ComboBox2.ResetText()

    End Sub
}
// 个人信息录入代码
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox2.Text = "" Then
            MessageBox.Show("必填项目不得为空!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning)
            Exit Sub
        End If

        Dim myview As DataView
        myview = New DataView(DataSet51.xuesheng, "", "xuehao", DataViewRowState.CurrentRows)
        Dim rowindex As Integer = myview.Find(TextBox1.Text)
        If rowindex = -1 Then
            Beep()
            MsgBox("数据库中未找到与此记录重复的数据,可以存入!")

            Dim str1, str2 As String
            str1 = "insert into xuesheng(xuehao, xingming, xingbie, banji, nianling"
            str2 = "values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & ComboBox1.Text & "','" & ComboBox2.Text & "','" & TextBox3.Text & "'"
            If TextBox4.Text <> "" Then
                str1 = str1 & ",dianhua"
                str2 = str2 & ",'" & TextBox4.Text & "'"
            End If
            If TextBox5.Text <> "" Then
                str1 = str1 & ",zhuzhi"
                str2 = str2 & ",'" & TextBox5.Text & "'"
            End If
            str1 = str1 & ")" & str2 & ")"
            Try
                Dim com As New OleDbCommand(str1, mycon)
                mycon.Open()

                com.ExecuteNonQuery()
                mycon.Close()
                MessageBox.Show("信息已成功存入数据库", "恭喜", MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
                DataSet51.Clear()
                OleDbDataAdapter2.Fill(DataSet51)
            Catch
                mycon.Close()
                MessageBox.Show(Err.Description, "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning)
            End Try
            TextBox1.Text = ""
            TextBox2.Text = ""
            TextBox3.Text = ""
            TextBox4.Text = ""
            TextBox5.Text = ""
            ComboBox1.ResetText()
            ComboBox2.ResetText()
        Else
            MsgBox("数据库中此记录已存在,请重新输入!")
        End If
    End Sub
End Class
成绩打印代码
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Label2.Text = "科目编号为" & ComboBox1.Text & "的课程全体学生的成绩为:"
        With Me.CrystalReportViewer2
            If Me.ComboBox1.SelectedItem(0) Is System.DBNull.Value Then
                .SelectionFormula = "isnull ({chengji.kemubianhao})"
            Else
                .SelectionFormula = "{chengji.kemubianhao}='" & Me.ComboBox1.SelectedItem(0) & "'"
            End If
            .RefreshReport()
        End With
    End Sub

上一页  [1] [2] [3] 

学生成绩管理系统ER图+流程图+组织结构图 第3页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。