0
string InsertQuery = ""; MySqlTransaction transaction; MySqlConnection con1 = new MySqlConnection(); MySqlDataAdapter ODA; string server = loggerConnectionString.servername; con1.ConnectionString ="server="localhost";uid=root;pwd=;database=globasys;"; con1.Open(); transaction = con1.BeginTransaction(); ODA = new MySqlDataAdapter(); InsertQuery = "Insert into tr_config_unit_params " + Environment.NewLine; InsertQuery += "(unit_param_id,unit_id, unit_param_desc, unit_param_opc_progid, unit_param_host, unit_param_link, unit_param_data_type, unit_param_type) " + Environment.NewLine; InsertQuery += " VALUES(@unit_param_id,@unit_id,@unit_param_desc, @unit_param_opc_progid, @unit_param_host, @unit_param_link, @unit_param_data_type, @unit_param_type)";; ODA.InsertCommand =new MySqlCommand(InsertQuery, con1); ODA.InsertCommand.Parameters.Add("@unit_param_id", MySqlDbType.Int32); ODA.InsertCommand.Parameters.Add("@unit_id"", MySqlDbType.Int32); ODA.InsertCommand.Parameters.Add("@unit_param_desc", MySqlDbType.VarChar); ODA.InsertCommand.Parameters.Add("@unit_param_opc_progid", MySqlDbType.VarChar); ODA.InsertCommand.Parameters.Add("@unit_param_host", MySqlDbType.VarChar); ODA.InsertCommand.Parameters.Add("@unit_param_link", MySqlDbType.VarChar); ODA.InsertCommand.Parameters.Add("@unit_param_data_type", MySqlDbType.Int32); ODA.InsertCommand.Parameters.Add("@unit_param_type", MySqlDbType.Int32); ODA.InsertCommand.Transaction = transaction; DataSet ds = new DataSet(); ds = dt; int y= ODA.Update(dt,"tr_config_unit_params"); transaction.Commit(); con1.Close();
を使用して値iがMysqldataadapter.updateを(使用150000行を挿入有するインサート)が、クエリが正常に実行されますがない行が存在しませんadvance .....MYSQLのデータベーステーブルに内</p> <p>おかげ挿入Mysqldataadapter.update()