예제 #1
0
파일: Form1.cs 프로젝트: Redplek/voda_new
 private void load_mysql_logs()
 {
     //Debugger.Break();
     try
     {
         MysqlControl mysql_control = new MysqlControl(mysql_options);
         mysql_control.clearTable();
         for (int i = 0; i < dataGridView1.RowCount; i++)
         {
             string test = dataGridView1[0, i].Value.ToString();
             //Debugger.Break();
             for (int j = 0; j < 8; j++)
             {
                 if (dataGridView1[j, i].Value == null)
                 {
                     dataGridView1[j, i].Value = "";
                 }
             }
             mysql_control.insertData(dataGridView1[0, i].Value.ToString(), dataGridView1[1, i].Value.ToString(), dataGridView1[2, i].Value.ToString(), dataGridView1[3, i].Value.ToString(), dataGridView1[4, i].Value.ToString(), dataGridView1[5, i].Value.ToString(), dataGridView1[6, i].Value.ToString(), dataGridView1[7, i].Value.ToString(), dataGridView1[8, i].Value.ToString(), main_title);
         }
         mysql_control.insertErrors(Not_in_xml, douplicates_in_xml);
     }
     catch (Exception ex) {
         Debug.WriteLine(ex);
     }
 }
예제 #2
0
파일: Form1.cs 프로젝트: Redplek/voda_new
        private void check_mysql_table(string table)
        {
            MysqlControl mysql_control = new MysqlControl(mysql_options);

            if (mysql_control.check_connection())
            {
                Debug.WriteLine("mysql connected");
                if (mysql_control.tableExists(table))
                {
                    Debug.WriteLine("table_exists");
                    mysql_options.table = table;
                }
                else
                {
                    Debug.WriteLine("no table");
                    mysql_control.createTable(table);
                    if (mysql_control.tableExists(table))
                    {
                        mysql_options.table = table;
                    }
                }
                //mysql_control.insertData(1,"1","1","0","1","1","1","1");
                //mysql_control.clearTable();
            }
        }