c# list批量添加 对象 到数据库的sql
2024-10-20 06:42:04
public void AddList(List<ProModule.Model.pro_manifest_item> list) { Hashtable SQLStringList = new Hashtable(); for (int i = 0; i < list.Count; i++) { MySqlParameter[] parameters = { new MySqlParameter(string.Format("@id{0}",i), MySqlDbType.VarChar, 50), new MySqlParameter(string.Format("@states{0}",i), MySqlDbType.Int32,11)}; parameters[0].Value = list[i].id; parameters[1].Value = list[i].states; SQLStringList.Add(string.Format("insert into pro_manifest_finished (id,states) values (@id{0},@states{0})", i), parameters); } DbHelperMySQL.ExecuteSqlTran(SQLStringList); }
SQLStringList的
key值:insert into pro_manifest_finished (id,states) values (@id1,@states1)
最新文章
- Java异常题库
- Android 自定义View 三板斧之一——继承现有控件
- Leetcode 160 Intersection of Two Linked Lists 单向链表
- Medial Queries的另一用法:实现IE hack的方法
- DELPHI2007 安装ACTIVEX插件的方法
- R语言决策树分类模型
- A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning
- iOS之GCD的局部解析
- NET 使用HtmlAgilityPack抓取网页数据
- eclispe输入@注解时提示所有注解的设置
- Oracle查询经典
- Linux里如何设置IP(RED HAT)
- OpenCV MFC 模块间通信
- a标签的背景图在ie8下不显示的问题
- HDU5914
- Azure MySQL PaaS (3) 创建MySQL异地只读数据库 (Master-Slave)
- nodejs之querystring模块
- linux下stricky
- 小程序App.js 传递数据给实例(app异步数据问题)
- 配置Spring MVC - 2019
热门文章
- centos7-vmware克隆后的配置
- <;Linux>; SSH配置之后 SHH slave1 测试 error:SSH: command not found
- hdfs 如何实现退役节点快速下线(也就是退役节点上的数据块快速迁移)speed up decommission blocks removal
- 转载:python 的包导入
- 2018年1月21日--2月4日 NAS
- 64位操作系统(Windows 2008 R2 X64)ASP.NET 调用32位Excel,word 出现401 – 未授权: 由于凭据无效,访问被拒绝。
- vs2008 ";不安全代码只会在使用 /unsafe 编译的情况下出现";的解决方法
- leetcode140
- linux终端发送邮件
- css3 之border-radius 属性解析