软件开发环境与工具实验报告题目: 三层架构实验序号: 实验 4 学号: 姓名: 班级: 日期: 一、实验目的通过本次实验,了解了三层架构实验的具体步骤和方法, 掌握了实验的具体内容。二、实验原理设计一个模拟登录界面,通过登录(姓名与密码)进入用户管理界面。用户管理界面创建四个用户操作功能,浏览. 修改. 新增. 删除。并将操作中数据变化同步到数据库, 实现数据库与用户管理的同步一体化。三、实验过程核心代码 Imports Public Class UserDao Public conn As New SqlConnection Public Function getData() As DataSet Dim ds As New DataSet = "server=;uid=sa;pwd=root;database=test" () Dim se As String = "select * from userMessage " Console .WriteLine(se) Dim da As New SqlDataAdapter (se, conn) (ds, "userMessage" ) () Return ds End Function Public Function update( ByVal userId As String , ByVal password As String , ByVal oldUserId As String ) As Integer Dim conn As New SqlConnection = "server=;uid=sa;pwd=root;database=test" () Dim updateString As String = "UPDATE userMessage set userId='" & userId & "',password='" & password & "' where userId='" & oldUserId & "'" Console .WriteLine(updateString) mand As mand = New mand (updateString, conn) Dim result As Integer = () () Return result End Function Public Function insert( ByVal userID As String , ByVal password As String ) As Integer Dim conn As New SqlConnection = "server=;uid=sa;pwd=root;database=test" () Dim insertString As String = "insert into
实验报告三层架构 来自淘豆网m.daumloan.com转载请标明出处.