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 ); }
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); }
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 ); }
public static SqlDataReader run_query(string query, ref SqlConnection conn ) { sql_code.prms_p prms = new business.sql_code.prms_p(); return(run_query(query, prms, ref conn )); }