Exemple #1
0
        public static void run_non_query(string query, prms_p prms
                                         )
        {
            SqlConnection
                conn = get_conn();

            SqlCommand cnt = new SqlCommand();

            cnt.Connection = conn;

            cnt.CommandText = query;

            if (prms == null
                )
            {
            }
            else
            {
                prms.decompile(ref cnt);
            }

            cnt.ExecuteNonQuery();

            cnt.Dispose();

            conn.Close();

            conn.Dispose();
        }
Exemple #2
0
        public static void revise(string tb, string column, int content, int ID
                                  )
        {
            string query = "update " + tb + " " +
                           "set " + column + " = " + content +
                           " where ID = " + ID;

            sql_code.prms_p prms = new prms_p();

            run_non_query(query
                          );
        }
Exemple #3
0
        public static void revise(string tb, string column, string content, int ID
                                  )
        {
            string query = "update " + tb + " " +
                           "set " + column + " = @content" +
                           " where ID = " + ID;

            sql_code.prms_p prms = new prms_p();
            prms.enroll("content", content, SqlDbType.VarChar
                        );
            run_non_query(query, prms
                          );
        }