コード例 #1
0
        public static bool Execute(string s)
        {
            s = s.Replace("'True'", "1");
            s = s.Replace("'False'", "0");
            SQL_Class sql_c = new SQL_Class();

            sql_c.Create_Connection(Properties.Settings.Default.BasePath);
            sql_c.Open_Connection();

            var temp = new MySqlCommand(s, SQL_Connection);

            try
            {
                temp.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                sql_c.Manualy_Close_Connection();
                return(false);
            }


            sql_c.Manualy_Close_Connection();
            return(true);
        }
コード例 #2
0
        public static SQL_Class Create_class()
        {
            SQL_Class sql_class = new SQL_Class();

            sql_class.Create_Connection(Properties.Settings.Default.BasePath);
            sql_class.Open_Connection();
            if (SQL_Connection.State != ConnectionState.Open)
            {
                return(null);
            }
            return(sql_class);
        }
コード例 #3
0
        public static SQL_Class Create_class(string base_path)
        {
            SQL_Class sql_class = new SQL_Class();

            sql_class.Create_Connection(base_path);
            sql_class.Open_Connection();
            if (SQL_Connection.State != ConnectionState.Open)
            {
                return(null);
            }
            return(sql_class);
        }
コード例 #4
0
        public static object ReadValue(string s, string base_path)
        {
            SQL_Class sql = new SQL_Class();

            sql.Create_Connection(base_path);
            sql.Open_Connection();
            MySqlCommand comand = new MySqlCommand(s, SQL_Connection);
            object       obj    = comand.ExecuteScalar();

            sql.Manualy_Close_Connection();
            return(obj);
        }
コード例 #5
0
        public static object ReadValue(string s)
        {
            SQL_Class sql = new SQL_Class();

            sql.Create_Connection(Properties.Settings.Default.BasePath);
            if (SQL_Connection.State == ConnectionState.Open)
            {
                SQL_Connection.Close();
            }
            sql.Open_Connection();
            MySqlCommand comand = new MySqlCommand(s, SQL_Connection);
            object       obj    = comand.ExecuteScalar();

            sql.Manualy_Close_Connection();
            return(obj);
        }