1.运行效果截图
2.输入用户名,密码进行查询
查找成功则显示
查找不成功显示用户信息不存在
3.输入用户名与密码,向数据库中添加用户信息
添加后数据库表信息
4.查看全部信息
5.根据编号信息进行查找,修改用户信息
6通过编号进行删除用户信息
数据库的sql语句
/*
Navicat SQL Server Data Transfer
Source Server : Sqlserver
Source Server Version : 110000
Source Host : localhost:1433
Source Database : syszyt
Source Schema : dbo
Target Server Type : SQL Server
Target Server Version : 110000
File Encoding : 65001
Date: 2018-10-27 10:38:33
*/
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE [dbo].[users]
GO
CREATE TABLE [dbo].[users] (
[code] int NOT NULL IDENTITY(1,1) ,
[name] varchar(20) NOT NULL ,
[pwd] varchar(20) NOT NULL
)
GO
DBCC CHECKIDENT(N'[dbo].[users]', RESEED, 11)
GO
-- ----------------------------
-- Records of users
-- ----------------------------
SET IDENTITY_INSERT [dbo].[users] ON
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'1', N'zhangsan', N'111')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'3', N'wangwu', N'333')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'4', N'zhaoliu', N'444')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'5', N'zyt', N'zyt123')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'6', N'zyt', N'1234')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'9', N'liyao', N'147')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'10', N'111', N'222')
GO
GO
INSERT INTO [dbo].[users] ([code], [name], [pwd]) VALUES (N'11', N'新东方', N'666')
GO
GO
SET IDENTITY_INSERT [dbo].[users] OFF
GO
-- ----------------------------
-- Indexes structure for table users
-- ----------------------------
-- ----------------------------
-- Primary Key structure for table users
-- ----------------------------
ALTER TABLE [dbo].[users] ADD PRIMARY KEY ([code])
GO
源代码
https://pan.baidu.com/s/1y15NygYMHzC_kR3zkxTivg
参考博客园链接http://www.cnblogs.com/Claires/p/4330849.html