- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
using (MySqlConnection mysqlConn = new MySqlConnection(connStr))
{
try
{
mysqlConn.Open();
Type Dbs = typeof(DbState);
foreach(string s in Enum.GetNames(Dbs))
{
Console.WriteLine(s + " : " + Enum.Format(Dbs, Enum.Parse(Dbs, s), "d"));
}
using (MySqlCommand mysqlCmd = new MySqlCommand("use oleg;", mysqlConn))
{
try
{
mysqlCmd.ExecuteNonQuery();
using (fact obj = new fact())
{
for (int i = 0; i < 10; i++)
{
using (MySqlCommand _mysqlCmd = new MySqlCommand("use oleg; insert into recursion_data values(null, " + obj.rec(i) + ");", mysqlConn))
{
_mysqlCmd.ExecuteNonQuery();
}
}
}
}
catch (Exception exc)
{
Console.WriteLine(exc.Message);
}
}
}
catch (Exception exc)
{
Console.WriteLine(exc.Message);
}
finally
{
mysqlConn.Close();
}