</pre>
=====データ登録(INSERT)=====<pre>public void Load(string host, string database, string user,string password, string fileName){ MySqlCommand insCmd = new MySqlCommand( @"insert into jra_data ( rec_spec, rec_key, make_date, data_type, data ) " + " values ( @rec_spec, @rec_key, @make_date, @data_type, @data )"); var conInfo = $"Database=jra;Data Source=192.168.0.2;User Id=jra;Password=password; pooling = false; convert zero datetime=True"; using (var conn = new MySqlConnection(conInfo)) { conn.Open(); insCmd.Connection = conn; using (var reader = new StreamReader(fileName)) { string line = null; while ((line = reader.ReadLine()) != null) { var record = line.Split("\t"); Debug.WriteLine(line); if (record.Length >= 5) { var recSpec = record[0]; var makeDate = record[1]; var dataType = record[2]; var recKey = record[3]; var data = record[4]; insCmd.Parameters.Clear(); insCmd.Parameters.Add(new MySqlParameter("rec_spec", recSpec)); insCmd.Parameters.Add(new MySqlParameter("rec_key", recKey)); insCmd.Parameters.Add(new MySqlParameter("make_date", makeDate)); insCmd.Parameters.Add(new MySqlParameter("data_type", dataType)); insCmd.Parameters.Add(new MySqlParameter("data", data)); insCmd.ExecuteNonQuery(); } } } }}</pre>=====データ取得(SELECT)=====
<pre>
using MySql.Data.MySqlClient;