Exemplo n.º 1
0
        public void submit()
        {
            string r = "insert into component ";

            r += " (name, comp_type, super_comp" + ", img" + ", format" +
                 ")";

            r += " values (@name, " + comp_type + "," + super_comp + ", @img" + ", @format" +
                 ")";

            sql_code.
            prms_p prms = new business.sql_code.prms_p();

            prms.enroll("name", name, System.Data.SqlDbType.Text
                        );

            prms.enroll("img", img, System.Data.SqlDbType.Binary
                        );

            prms.enroll("format", format, System.Data.SqlDbType.Text
                        );

            sql_code.run_non_query(r, prms
                                   );
        }
Exemplo n.º 2
0
        public void submit()
        {
            string r = "insert into " +
                       "img_stg";

            r += " (ID, img" + ", format" +
                 ")";

            r += " values (@ID, @img" + ", @format" +
                 ")";

            sql_code.
            prms_p prms = new business.sql_code.prms_p();

            prms.enroll("ID", ID, System.Data.SqlDbType.Text
                        );

            prms.enroll("img", img, System.Data.SqlDbType.Binary
                        );

            prms.enroll("format", format, System.Data.SqlDbType.Text
                        );

            sql_code.run_non_query(r, prms
                                   );
        }
Exemplo n.º 3
0
        public static List <component_p> search(string content
                                                )
        {
            string r = "select * from component where name like @content";

            r += " order by upper(name), ID";
            sql_code.prms_p prms = new business.sql_code.prms_p();
            prms.enroll("content", "%" + content +
                        "%", System.Data.SqlDbType.VarChar
                        );

            SqlConnection conn = null;

            SqlDataReader SDR = sql_code.run_query(r, prms,
                                                   ref conn
                                                   );
            List <component_p> comps = new List <business.component_p>();

            for (; SDR.Read();
                 )
            {
                component_p c = get(SDR);

                comps.Add(c);
            }

            SDR.Close();

            conn.Close();

            conn.Dispose();

            return(comps);
        }