• C#winform窗体实现对sql server数据库的增删改查


    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

  • 相关阅读:
    Django的sitemap
    meibu ddns update command
    nginx笔记
    docker里运行cron的要点笔记
    win2008r2 32位odbc安装笔记
    【转载】利用tasker推送手机短信到企业微信(App或者微信公众号)
    关闭树莓派的优化笔记
    自已编译openweb docker image笔记
    【笔记】元学习专题视频(台大·李宏毅)学习记录
    【教程】基于Ubuntu系统的PyTorch虚拟环境配置
  • 原文地址:https://www.cnblogs.com/zyt-bg/p/9859203.html
Copyright © 2020-2023  润新知