摘自: http://blog.csdn.net/myjlvzlp/article/details/8434376 1.批量添加元素session.insert(String string,Object o) public void batchInsertStudent(){ List<Student> ls = new ArrayList<Student>(); for(int i = 5;i < 8;i++){ Student student = new Student(…
1.批量添加元素session.insert(String string,object O) public void batchInsertStudent(){ List<Student> ls = new ArrayList<Student>(); for(int i = 5;i < 8;i++){ Student student = new Student(); student.setId(i); student.setName("maoyuanjun"…
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), MySqlDbT…
自曾列就别往下看 别折腾了 使用 SqlBulkCopy ,dataTable 必须跟sql里面的表字段完全一样 下面在sqlserver中演示 mysql 请google MySqlBulkLoader oracle 请google OracleBulkCopy 表结构 DROP TABLE [dbo].[Product] GO CREATE TABLE [dbo].[Product] ( ) NOT NULL , ) NOT NULL , ,) NOT NULL ) GO ALTER T…