数据库课程电话计费管理系统 下载本文

End Function

Function InsertUserInfo(ByVal Userdbs As UserInfoClass) As UserInfoClass Throw New NotImplementedException End Function End Class

Public Class UserInfoClass

Private UserName As String Public Property Name As String Get

Return UserName End Get

Set(ByVal value As String) UserName = value End Set End Property

Private UserPwd As String

Public Property Password As String Get

Return UserPwd End Get

Set(ByVal value As String) UserPwd = value End Set End Property End Class

执行增删改查函数模块(部分):

Imports

Public Class kehuchaxunForm1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim did As String = Me.TextBox1.Text

Dim connectionString As String = \ Dim commandText As String = \ Using connection As New SqlConnection(connectionString)

Dim Command As SqlCommand = New SqlCommand(commandText, connection) connection.Open()

Dim reader As SqlDataReader = Command.ExecuteReader() While (reader.Read() = True)

Me.TextBox1.Text &= reader(0) & \ & reader(1) & \ & reader(2) & vbCrLf End While

connection.Close() End Using End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged End Sub End Class

Imports //删除

Public Class kehushanchu

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim did As String = Me.TextBox1.Text

Dim connectionString As String = \ Dim commandTextDelete As String = \ Using connection As New SqlConnection(connectionString) connection.Open()

Dim cmdDelete As SqlCommand = New SqlCommand(commandTextDelete, connection) \, TextBox1.Text) Try

Dim result As Integer = cmdDelete.ExecuteNonQuery() If result = 1 Then MsgBox(\成功\) Else

MsgBox(\删除记录失败\) End If

Catch ex As Exception MsgBox(ex.ToString()) End Try

connection.Close() End Using End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class

Imports //插入

Public Class kehutianjiaForm1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim connectionString As String = \

Dim commandTextInsert As String = \VALUES(@a,@b,@c)\

Using connection As New SqlConnection(connectionString) connection.Open()

Dim cmdInsert As SqlCommand = New SqlCommand(commandTextInsert, connection) \, TextBox1.Text) \, TextBox2.Text) \, TextBox3.Text) Try

Dim result As Integer = cmdInsert.ExecuteNonQuery() If result = 1 Then

MsgBox(\插入成功\) End If

Catch ex As Exception MsgBox(ex.ToString()) End Try

connection.Close() End Using End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class

Imports //修改

Public Class kehuxiugai

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim connectionString As String = \

Dim commandTextUpdate As String = \kehuxingming=@aaa\

Using connection As New SqlConnection(connectionString) connection.Open()

Dim cmdUpdate As SqlCommand = New SqlCommand(commandTextUpdate, connection) \, TextBox1.Text)

\, TextBox2.Text) \, TextBox3.Text) Try

Dim result As Integer = cmdUpdate.ExecuteNonQuery() If result = 1 Then

MsgBox(\修改成功\) Else

MsgBox(\修改失败\) End If

Catch ex As Exception MsgBox(ex.ToString()) End Try

connection.Close() End Using End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub

Private Sub kehuxiugai_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub End Class

8. 实验总结:

过这次课程设计,从设计需求分析,到各模块功能的设计及数据库设计,我对电话计费管理系统有了较深入的了解, 基本掌握了数据库设计的思想。 通过本次设计,对数据库系统概论这门课有了全新的认识,经过本次课程设计, 我受益匪浅, 从一个整体上把握了一个数据库的设计方法,同时对于如何利用vb.net语言去连接数据库, 并且操纵数据库有了一定的了解和掌握。希望以后自己能够继续学习数据库,对它有更深层次的了解。 项目的开发过程:系统分析->建模->概要设计->详细设计->编码->测试->维护。

软件开发时期的具体设计和实现在前一个时期定义的软件,4个阶段组成:概要设计、详细设计、编码和单元测试、综合测试,其中前两个阶段又称为系统设计,后两个阶段又称为系统实现。运行维护时期的主要任务是使软件持久地满足用户的需要。

数据流图(data flow diagram,DFD)是一种图形化技术,它描绘信息流和数据从输入移动到输出的过程中所经受的变换。