比如从现在开始一直循环到后年,比如设置8根管线,一直循环下去进行数据叠加,下面是C#代码,不知道怎么写下去了
private void button1_Click(object sender, EventArgs e)
{
connectionString = “SERVER=” + server + “;” + “DATABASE=” + database + “;” + “UID=” + uid + “;” + “PASSWORD=” + password + “;” + “CHARSET=” + charset + “;”;
connContinueRunProtcl2 = new MySqlConnection();?? // 实例化数据库连接(instanced)
connContinueRunProtcl2.ConnectionString = connectionString;?? // 配置连接(configured)
connContinueRunProtcl2.Open();?? // 打开连接(opened)
MySqlCommand myCommand = connContinueRunProtcl2.CreateCommand();
myCommand.CommandText = “INSERT INTO historydata(时间,管线) VALUES(now(),1)”;
MySqlDataReader myDatareader = myCommand.ExecuteReader();
myDatareader.Close();
connContinueRunProtcl2.Close();