上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 44 下一页
摘要: 在这点我们需要使用到的sql语句 语法: update 表名 set 某个值=case when @你要修改的值 > 表中的某一个值 then 成立之后要设置的值 else 前面没有成立设置的值 end 举例: 我根据传入的年龄age来设置type为1还是0,1表示成年,0表示未成年 update 阅读全文
posted @ 2024-06-19 16:15 龙卷风吹毁停车场 阅读(51) 评论(0) 推荐(0)
摘要: ExecuteScalar 方法允许我们查询单一结果,我们来看看什么是单一结果,有那些需要注意的事项 1. 下面是我对 ExecuteScalar 的简单封装,接下来我们看看,如何使用 /// <summary> /// 查询单一结果 /// </summary> /// <param name=" 阅读全文
posted @ 2024-06-19 11:57 龙卷风吹毁停车场 阅读(85) 评论(0) 推荐(0)
摘要: 1, 在winform项目中 Program.cs 文件里添加 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Ta 阅读全文
posted @ 2024-06-18 16:05 龙卷风吹毁停车场 阅读(30) 评论(0) 推荐(0)
摘要: 找到问题: 是应为我在 ExecuteReader方法 finally中加入了 conn.close(); 导致了我UI层在使用Read的时候, 数据库的链接已经被 finally 里面的conn.close()关闭了 阅读全文
posted @ 2024-06-18 15:16 龙卷风吹毁停车场 阅读(38) 评论(0) 推荐(0)
摘要: /// <summary> /// 事务处理 /// </summary> /// <param name="sqlList">sql语句数组</param> /// <returns></returns> /// <exception cref="Exception"></exception> p 阅读全文
posted @ 2024-06-18 09:13 龙卷风吹毁停车场 阅读(29) 评论(0) 推荐(0)
摘要: ContextMenuStrip属性: 当用户点击鼠标右键时(设置和contextMenuStrip挂钩) MultiSelect属性 是否可以多行选择 SelectionMode属性: 设置选中方式,比如是否选中一整行(设置为FullRowSelect) Dock属性: 设置显示位置 AllowU 阅读全文
posted @ 2024-06-17 18:09 龙卷风吹毁停车场 阅读(63) 评论(0) 推荐(0)
摘要: BindingSource bindingSource = new BindingSource(); bindingSource.DataSource = products1; this.dataGridView1.DataSource = bindingSource; 然后: 你该怎么操作怎么操作 阅读全文
posted @ 2024-06-17 09:22 龙卷风吹毁停车场 阅读(99) 评论(0) 推荐(0)
摘要: 1. 将 EnableHeadersVisualStyles 设置为 false, 自定义的样式才会显示2. 将ColumnHeadersDefaultCellStyle 样式按照你自己的需求设置(可以设置表头背景颜色,表头字体样式,等)3, 设置 表头单元格边框样式 ColumnHeadersBo 阅读全文
posted @ 2024-06-16 11:25 龙卷风吹毁停车场 阅读(132) 评论(0) 推荐(0)
摘要: 1. 安装两个 nuget 包 2. 创建 log4net.config 文件 ,选中 文件鼠标右键,选择属性->复制到输出目录 修改为 始终复制 <?xml version="1.0" encoding="utf-8" ?> <configuration> <!--只保留创建日期是最近1天的--> 阅读全文
posted @ 2024-06-15 10:03 龙卷风吹毁停车场 阅读(336) 评论(0) 推荐(0)
摘要: using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using 阅读全文
posted @ 2024-06-14 19:28 龙卷风吹毁停车场 阅读(13) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 44 下一页