上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 28 下一页
摘要: cmd.CommandText = "Update UserInfo set DelFlag=1 where UserId = @UserId"; //方法一 cmd.Parameter.AddWithValue("@UserId",deleteUserId); //方法二 SqlParameter 阅读全文
posted @ 2017-05-05 11:13 逍遥小天狼 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 说明:比较完整的增删查改 1:新建窗体项目,(命名规范) 2:添加dataGridView控件 3:通过AppConfig创建连接字符串 <connectionStrings> <add name="connStr" connectionString="server=.;uid=sa;pwd=sa; 阅读全文
posted @ 2017-05-04 18:02 逍遥小天狼 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 说明 :观察者模式又叫发布-订阅模式,其中又涉及到中介者模式 1 结构 2 创建Main窗体(中介者),ChildForm1(发布者),ChildForm2(订阅者),ChildForm3(订阅者), 2.1 ChildForm1中添加按钮,当按钮被点击是ChildForm2(订阅者),ChildF 阅读全文
posted @ 2017-05-04 14:10 逍遥小天狼 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 说明 :步步为营-27-事件以前用委托做过窗体之间传值 1 通过属性数据交互 1.1 在子窗体中添加属性Form1属性 public Form1 Form1 { get; set; } 1.2 在父窗体中添加SetText 方法,来给文本框赋值 public void SetText(string 阅读全文
posted @ 2017-05-03 17:59 逍遥小天狼 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 说明:通过DataAdapter或者dataset连接数据库,实现对数据增删改查操作. 以前写过一篇步步为营-23-通过GridView实现增删改 1:SqlDataAdapter DataTable实现 using System; using System.Collections.Generic; 阅读全文
posted @ 2017-04-28 14:15 逍遥小天狼 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 说明:登录失败3次,15分钟后才能登录 using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using 阅读全文
posted @ 2017-04-27 16:46 逍遥小天狼 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 说明: ComboBox的使用 1:准备数据 USE [master] GO /****** Object: Database [DBProvinceCity] Script Date: 2017-04-27 09:27:48 ******/ CREATE DATABASE [DBProvinceC 阅读全文
posted @ 2017-04-27 10:10 逍遥小天狼 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 说明:数据的导入导出功能在企业中还是比较常用的,下面先介绍txt文件的导入导出,但是企业中一般是用Excel导入导出 1 先建UI页面 2清空数据库数据 3 导入数据 4导出数据 代码 using System; using System.Collections.Generic; using Sys 阅读全文
posted @ 2017-04-26 17:39 逍遥小天狼 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 说明 :通过连接字符串判断用户名和密码是否一致,主要想使用配置文件解决数据库连接问题 1 先建UI界面 2 代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Dat 阅读全文
posted @ 2017-04-26 10:46 逍遥小天狼 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 说明:propertyGrid的使用 ,其中涉及到一个复制到粘贴版功能 1:先建立UI界面 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using Sy 阅读全文
posted @ 2017-04-25 23:03 逍遥小天狼 阅读(218) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 28 下一页