If the Parameter order is incorrect, an error occurs.
But insert or update
internal static int insertproducts (tproducts products) {string SQL = "insert into [products] ([name], [price], [pricing], [content], [time], [Picture]) values (@ name, @ price, @ pricing, @ content, @ time, @ picture) "; oledbparameter [] parameters = new oledbparameter [] {accesshelper. parameter ("@ name", products. strname), accesshelper. parameter ("@ price", products. decprice, oledbtype. numeric), accesshelper. parameter ("@ pricing", products. decpricing, oledbtype. numeric), accesshelper. parameter ("@ content", products. strcontent), accesshelper. parameter ("@ time", datetime. now, oledbtype. date), accesshelper. parameter ("@ picture", products. strpicture)}; int inttemp = accesshelper. executenonquery (SQL, parameters); setsum (); Return inttemp ;}
accesshelper. parameter ("@ name", products. strname), accesshelper. parameter ("@ price", products. decprice, oledbtype. numeric), accesshelper. parameter ("@ pricing", products. decpricing, oledbtype. numeric), accesshelper. parameter ("@ content", products. strcontent), accesshelper. parameter ("@ time", datetime. now, oledbtype. date), accesshelper. parameter ("@ picture", products. strpicture)
If the Parameter order is incorrect, an error occurs.
However, It is insert or update.