管理信息系统课程设计报告---车辆租赁管理系统内容摘要:

() End Sub Private Sub DataGridView1_CellContentClick(ByVal sender As , ByVal e As ) Handles End Sub Private Sub Button2_Click(ByVal sender As , ByVal e As ) Handles () () End Sub End Class 会员客户信息模块设计 下图为会员客户信息模块布局,双 击“显示”按钮,输入相应代码建立与数据库的连接,运行时在 DataGridView控件中显示数据库中表的信息,单击“返回”按钮返回到主界面。 运行结果如下图 图 55 会员客户信息界面运行结果 15 程序运行代码如下 Imports Imports Public Class Form6 Private Sub DataGridView1_CellContentClick(ByVal sender As , ByVal e As ) Handles End Sub Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles Dim strconn As String = data source=ZVDPFX4AFDLGOF2。 initial catalog=lwn。 amp。 integrated security=true。 Dim conn As New SqlConnection(strconn) Dim strsel As String = select * from TABLE2 Dim m As New SqlCommand(strsel, conn) () Dim da As SqlDataAdapter = New SqlDataAdapter = m Dim ds As DataSet = New DataSet (ds, stu) = (stu) () End Sub Private Sub Button2_Click(ByVal sender As , ByVal 16 e As ) Handles () () End Sub End Class 汽车类型设置模块设计 下图为添加信息模块布局,在 textbox 控件中输入要添加的汽车名称、汽车型号、汽车价格, 双击“添加”按钮输入代码,运行时点击“添加”按钮,弹出添加成功对话框,即在相应数据库中成功添加信息。 运行结果如下图 图 56 添加信息 界面 运行结果 程序运行代码如下 Imports Imports Public Class Form3 Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles 17 Dim strconn As String = data source =ZVDPFX4AFDLGOF2。 initial catalog = lwn。 amp。 integrated security =true。 Dim conn As New SqlConnection(strconn) Dim strtianjia As String = insert into table8(carname,typeid,price)VALUES(39。 + + 39。 ,39。 + + 39。 ,39。 + + 39。 ) Dim m As New SqlCommand(strtianjia, conn) () () () MsgBox(添加成功。 ) End Sub End Class 下图为修改信息模块布局, ,在 textbox 控件中输入要修改的汽车型号、汽车名称、汽车价格,双击“修改”按钮输入代码,运行时点击“修改”按钮,弹出对话框,即在相应数据库中成功修改信息。 运行结果如下图 图 57 修改信息界面运行结果 18 程序运行代码如下 Imports Imports Public Class Form7 Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles Dim strconn As String = data source =ZVDPFX4AFDLGOF2。 initial catalog = lwn。 amp。 integrated security =true。 Dim conn As New SqlConnection(strconn) Dim strXIUGAI As String = UPDATE table8 SET carname=39。 + + 39。 + ,price=39。 + + 39。 where type id=39。 + + 39。 Dim m As New SqlCommand(strXIUGAI, conn) () If (()) Then MsgBox(信息已修改,请继续操作。 ) Else MsgBox(不存在该记录。 ) End If () End Sub End Class 3. 设计删除信息模块 下图为删除信息模块布局 ,在 textbox 控件中输入要删除的汽车型号、双击“删除”按钮输入代码,运行时点击“删除”按钮,弹出对话框,即在相应数据库中成功删除信息。 运行结果如下图 19 图 58 删除信息 界面 运行结果 程序运行代码如下 Imports Imports Public Class Form5 Private Sub Button1_Click(ByVal sender As , ByVal e As ) Handles Dim strconn As String = data source=ZVDPFX4AFDLGOF2。 initial catalog=lwn。 amp。 integrated security=true Dim conn As New SqlConnection(strconn) Dim strdel As String = delete from table8 where typeid=39。 amp。 Trim() amp。 39。 Dim m As New SqlCommand(strdel, conn) () If (()) Then MsgBox(记录已删除。 ) Else 20 MsgBox(不存在该记录。 ) End If End Sub End Class 4. 设计 显示 信息模块 下图为显示信息模块布局, 双击“显示”按钮,输入相应代码建立与数据库的连接,运行时在 DataGridView 控件中显示数据库中表的信息。 运行结果如下图 图 59 显示信息 界面 运行结果 问题分析 在设计过程中较难实现的就是 Visual 与 SQL 数据库的连接,下面就此问题进行详细 分析。 1. 常用的 SQL 语句 SELECT 语句:实现数据查询。 INSERT 语句:插入数据。 UPDATE:更新数据。 DELETE:删除数据。 SELECT 各子句的主要功能。 21 2. ADO 数据访问技术 ActiveX Data Objects 的缩写,提供对各种数据库访问的标准接口。 包括的主要对象有: 连接对象 Connect。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。