I am trying to insert 2 Milion Rows to MySql database in a single commit. But I could not find better solutions for this operation. For the MsSql I found the following solution.
SqlBulkCopy objbulk = new SqlBulkCopy(conn1);
//assign Destination table name
objbulk.DestinationTableName = "WinerDetails";
objbulk.ColumnMappings.Add("Ref_ID", "Ref_ID");
objbulk.ColumnMappings.Add("Region_ID", "Region_ID");
conn1.Open();
//insert bulk Records into DataBase.
objbulk.WriteToServer(tbl);
conn1.Close();
Is there any similar method to insert data in MySQL as above??